US President Donald Trump still has time to avoid a trade war over tariff hikes aimed at Canada, the European Union and Mexico, G7 finance ministers says after a meeting in the Canadian ski resort town of Whistler.

US Treasury Secretary Steven Mnuchin was clearly told that it is now up to the US to smooth things over and avoid a trade war, diplomats said after the meetings ahead of the main G7 summit in Canada next week.

READ MORE Trump tells allies to fix US trade balance

"We still have a few days to take the necessary steps to avoid a trade war between the EU and the US, and to avoid a trade war among G7 members," French Finance Minister Bruno Le Maire told reporters.

"The ball is in the camp of the United States, it is up to the American administration to take the right decisions to smooth the situation and to alleviate the difficulties," he added.

Canada and the EU have both filed cases at the World Trade Organisation challenging tariffs of 25 percent on steel and 10 percent on aluminium imports to the US announced by Trump on Thursday. Mexico is also affected by the tariffs.

Canada has threatened to impose retaliatory tariffs on the US on items including agricultural products, which could hit rural areas of the US, where Trump has many supporters.

The EU has said the bloc will also apply tariffs in retaliation.

Such a stark disagreement is unusual in the G7 group, which is comprised of the world's seven largest economies: the United States, Canada, France, Germany, Italy, Japan, and Britain.