Va. Del. Jeion Ward (D-Hampton), who sponsored the driver’s ed bill, said she began thinking last year about drivers’ interactions with police during traffic stops after community forums on police-related violence. (Tracy A. Woodward/The Washington Post)

Jeion Ward decided it was time to do something about teaching young drivers how to handle a police stop when she realized her grandson had reached driving age.

“My grandbaby!” said Ward, a delegate who represents Hampton in the Virginia General Assembly. As an African American, she has seen her husband and three grown sons deal with what many describe as the special tension of interacting with police while black.

So Ward crafted a bill requiring driver’s education classes to teach students how to handle themselves during a traffic stop.

On Monday, Gov. Terry McAuliffe (D) signed Ward’s bill into law, making Virginia one of only a handful of states grappling with an issue made urgent by the high-profile wave of police-related shootings of African Americans in the past few years.

Illinois enacted a similar measure last year. Texas, North Carolina and Mississippi are among states currently weighing their own legislation.

The Virginia law, which takes effect July 1, applies to driver’s ed programs in public schools, which are sometimes taught by private driving schools under contract. Most high schools in Virginia offer driver’s education classes.

Ward said several states have called her seeking advice, but she told them Virginia has a few months to work out the details of the curriculum. In the meantime, she thinks the main thing is to get drivers and police interacting and thinking about how to handle an inherently stressful situation.

“This should at least make all of us mindful of what we should do,” Ward said. “I don’t believe most of us know.”

Shootings of black motorists, amplified in recent years by social media, have triggered demonstrations throughout the country and spurred the creation of the Black Lives Matter movement. Nationwide since January 2015, police have killed at least 193 people who were inside vehicles, according to a Washington Post database that tracks police shootings.

All the attention has left police and drivers feeling nervous during confrontations, which can be especially unsettling for new drivers. Virginia high school students who take driver’s education classes before getting their permits may not get instruction about what to do if they are pulled over by police; it’s up to the teachers.

Hampton High School sophomore Xaiver Williams, 16, said he passed the class last December and may have gotten some common-sense warnings about staying calm, but there was nothing specific.

But his father, a firefighter, passed along some tips from his buddies on the force: “Remain calm. Wait for them to come to the door. Let them know you’re going to grab the registration from the glove box. Say ‘yes, Ma’am’ or ‘yes, Sir,’ ” Williams said.

While he hasn’t yet faced a traffic stop, he said an African American friend called the day before upset after being pulled over for speeding. Williams counseled calm; the friend got off with a warning.

Ward said she began thinking about the topic last year after several community forums on police-related violence. Then, over Christmas, she heard her youngest son, 39, giving his son some advice about interacting with police.

That’s when she wondered: Her grandson is 17 and 6-foot-4; how would a nervous police officer react to him, walking up to that driver’s side window?

Her husband had been pulled over enough as a youth to make him counsel their sons about the topic. And her boys all seemed to have more than their share of traffic stops. Nothing ugly, but enough to make her wonder why.

So Ward called a friend who ran a driving school. He wasn’t required to teach anything about police stops, he said, but he and some other instructors had put together some informal pointers. Next, she looked at the state code, and while it spelled out instructions for fuel efficiency, motorcycle safety and even organ donation, there was no mention of proper interaction with police.

That’s when she decided to act. The resulting bill sailed through the General Assembly. The state Department of Education, Department of Motor Vehicles and police will work together to draw up a curriculum that will go into effect this summer.

DMV Commissioner Richard Holcomb acknowledged that the Virginia driver’s manual is vague on the topic. Under a list of tips for traffic stops, “the very first bullet is ‘remain calm,’ which is obviously a lot easier said than done when you’ve got that blue light flashing behind you,” he said.

In a signing ceremony Monday in Hampton attended by police, state officials and school kids, McAuliffe said the bill was “an easy one to do.” Especially, he said, because one of his five children is about to get her driver’s license.

Kevin Davis, a principal of Hampton High School, said many parents give their kids advice about how to interact with police — and so do siblings, friends and teachers. But given the tension in society over this issue, it’s best to have something more formal.

Young people, he said, need to learn “when to keep your mouth closed. And when you do need to talk, not to have that boldness about you that you know everything.”