Children and teachers could be made to transfer to alternative schools if their own is shut as the coronavirus escalates, under a series of emergency laws being drawn up by the government.

The government plans to pass legislation creating powers it can use if the outbreak becomes more serious and medical experts deem that “social distancing” is necessary to control its spread.

These are expected to include the power to detain people at the border for the purposes of carrying out medical checks; allowing more extensive use of court hearings by video link, as already happens in certain cases; and enabling the government to shut down large-scale public events – though the government believes many would be cancelled voluntarily.

Boris Johnson played down the risks of widespread school shutdowns at a press conference to deliver the government’s coronavirus “battle plan” on Tuesday, saying: “We don’t think schools should be closing in principle. If possible they should stay open but school authorities should follow the advice of Public Health England.”

But the government wants to be prepared to tackle potential teacher shortages in individual schools or areas. Legislation is expected to permit the relaxing of constraints on class sizes and the sending of pupils and teachers to other schools if theirs is closed or demand is created by staff being off sick.

Officials say new powers would not be used at this stage of the outbreak but could be triggered either if the World Health Organization declares that the risks have escalated or if a group of countries, including the UK, makes a coordinated decision that the virus has entered a new phase.

The powers would be strictly temporary, either through the inclusion of a sunset clause or by allowing the legislation to lapse once the chief medical officer and chief scientific officer declare that the disease is no longer an epidemic.

Whitehall departments have drawn up their own action plans for tackling coronavirus, the prime minister’s official spokesman said on Tuesday. “Each department is currently working on its own individual plan and will have its own ministerial lead to ensure it has the best possible response to coronavirus,” he said.

Detailed plans the government put in place to prepare for a potential no-deal Brexit last year had helped departments to understand the risks of disruption, the spokesman claimed.

“We do have well developed plans in relation to supply chains. There are specific plans in place in relation to medical stockpiles in particular, and that work has already taken place. It’s certainly the case that we have been able to learn from the process of making preparations for no deal.”

Asked if the government is concerned about the challenge of maintaining supplies of food and other essential commodities, he added: “Supermarkets have themselves been setting out details of their plans. I don’t think we see anything at the moment to suggest there is an issue, but we will continue to need to look at all these matters, if more cases are recorded.”

Johnson gave a rare Downing Street press conference to explain the government’s contingency plans on Tuesday. He was flanked by scientific experts, who Downing Street’s research has suggested are most trusted by the public to carry crucial health messages.

More details of a planned large-scale public information campaign will emerge this week. It is expected include a robust message about the risks of lax hygiene.

After Johnson was criticised by Labour for failing to take a personal role in the coronavirus crisis in its early days, he has visited hospitals and is expected to make more statements in the coming days.

“You can expect us to be regularly updating the public on the steps we can take. You have seen the prime minister on a number of occasions in recent days and I would expect that to continue,” he added.