Cyclists on cellphones could get a safety lesson under a law proposed Thursday by Brooklyn Councilman Mark Treyger.

The bill would ban cellphone use while bicycling, with a safety class as punishment for first-time offenders. Treyger said he was inspired by a bicyclist texting while riding past his office on Stillwell Avenue, "veering into incoming traffic, almost causing a multi-car crash."

"I was surprised to learn there's no law, there's no prohibition against this reckless practice," Treyger said.

But an NYPD spokeswoman said police officers have already been writing up moving summonses for this kind of distracted bicycling. As of Nov. 9, 423 tickets had been issued this year to cyclists for using cellphones; 213 tickets were issued during the same period last year, according to the NYPD.

Under Treyger's bill, the city would devise a safety course for bicyclists to take for their first infraction in lieu of a $50 fine; a second offense could result in a fine as high as $200.

But bike advocates who have criticized distracted cyclists believe Treyger's bill will take police resources away from the real danger on city streets.

"The council and the NYPD need to focus the resources they have for the Vision Zero effort on driver speeding and failure to yield right of way, the reckless behaviors that cause the overwhelming majority of traffic fatalities and serious injuries in New York City," Transportation Alternatives said in a statement.