Lawmakers said the bill approved 52-0 on Wednesday was in response to recent incidents in Chicago. Groups of young people have descended on Michigan Avenue and other locations to attack or rob victims.
Sen. Kwame Raoul is a Chicago Democrat. He says street gangs also have used social media such as Twitter to organize and publicize attacks in other areas.
Sen. Kirk Dillard, a Hinsdale Republican, says the incidents could hurt business and that the legislation "sends a message."
The bill would allow a judge to impose an extended sentence if someone used electronic communication in a mob action. It now moves to the Illinois House.