A hall showing off electric vehicles made by Nio, XPeng Motors, Zeekr and dozens of other Chinese companies was mobbed with visitors. An area nearby full of gasoline-powered cars by foreign brands barely got a second look by anyone.

At the same event, Volkswagen, which vies with Toyota to be the world’s biggest seller of cars with combustion engines, issued a bold forecast: Within two years, half the cars sold in China, the world’s largest automobile market, will be electric, up from only 6 percent in 2020.

The theme at the Shanghai auto show this week was clear. Electric cars are here to stay, and Chinese automakers are leading the field.

Silvio Pietro Angori, the chief executive and managing director of Pininfarina of Italy, a nearly century-old car design business, said the global industry is not going back.

The internal combustion engine, he said, “is done, it’s gone, it doesn’t exist any more.”

The Shanghai auto show is one of the world’s biggest, and the first of its size in China since 2019. During the pandemic, when China’s borders were sealed because of “zero Covid” precautions, its auto industry was quietly transformed and the market share of foreign companies shrank. Today half the cars sold in Shanghai itself are already electric.

Brian Gu, the president and vice chairman of Xpeng, said that his company planned to reduce the cost of building a powertrain — primarily the battery and electric motor — by 25 percent by the end of the year. Powertrains, particularly the batteries, represent about two-fifths of Xpeng’s overall cost of building an electric car.

Ashwani Gupta, the chief operating officer of Nissan, one-upped Xpeng, saying that his company’s latest designs would cut powertrain costs by 30 percent. Shohei Yamazaki, the chairman of Nissan’s China investments subsidiary, said that Nissan would rely heavily on Chinese suppliers.

“Price competition in China is very fierce right now,” he said.

Chinese brands have adopted unusual electric car designs while foreign companies and their Chinese joint ventures have played it safe. The wheels are nearly at the corners of the Chinese brand cars, an architecture that also allows more room for batteries under the floor in the middle. Nio and Xpeng have chosen sleek designs, while Changan, based in western China, is making cars so rectangular that they look faintly Cubist.

“Some of that comes from the freedom from legacy,” said Felix Kilbertus, the chief creative officer at Pininfarina.

Great Wall, a Chinese maker of sport utility vehicles, has a new electric car brand, Ora, that is targeted to women. It named car models for cats, partly to appeal to lovers of the Hello Kitty brand. It has an electric car that strongly resembles a Volkswagen Beetle.

The main market for electric cars so far is China — E.V.s were a quarter of China’s market last year, compared with less than 6 percent in the United States.

Most of the cars displayed at the auto show use lithium batteries, the current industry standard, though companies are developing vehicles that run fully or partly on batteries made of sodium.

At the moment there is a glut of lithium batteries, but long term many in the industry believe sodium can become a viable alternative or supplement to lithium as a key ingredient in E.V. batteries. For one thing, the production of sodium batteries would be better for the climate.

Toyota’s chief scientist, Gill Pratt, contended at a session of the World Economic Forum in Davos in January that overall greenhouse gas emissions could be reduced more by replacing 90 gasoline cars with hybrid cars than by using the same amount of scarce lithium to build one battery-electric car.

“If you think about the total amount of lithium that the world has, the key is, let’s use it where it does the most good,” he said.

Toyota has a vested interest in questioning the availability of lithium. It owns many key patents for hybrid cars, and has emphasized them over entirely electric cars that require far more lithium. American and European automakers like Ford and Volkswagen, as well as most Chinese automakers, are still betting on battery-electric cars.

Prototype cars with all-sodium batteries that were disclosed in recent weeks by Chinese domestic carmakers and battery manufacturers have been low-budget microcars. One of them, the Sihao Huaxianzi from JAC Motors, in collaboration with HiNA, a sodium battery start-up, is designed for a top speed of 75 miles an hour.

Pulkit Khurana, a co-founder of Battery Smart, an Indian company that provides batteries for three-wheeled auto rickshaws, expressed doubt that any technology, including sodium, would displace conventional lithium batteries soon. And with the price of lithium having dropped by two-thirds since November, the cost of lithium batteries is likely to drop significantly, he said.

A midsize car or sport utility vehicle would have enough room for a far larger sodium battery than the low-cost subcompacts that Chinese manufacturers are initially building. Another possibility is to use a combination of sodium and lithium cells in a single car battery.

Using an artificial intelligence computer program, China’s CATL, the world’s largest manufacturer of electric car batteries, has figured out the complex electronics and programming for battery packs with some lithium cells and some sodium cells, said Huang Qisen, the deputy dean of company’s research institute.

CATL — the company’s full name is Contemporary Amperex Technology Ltd. — said at the auto show that it would make sodium battery cars in cooperation with Chery, a Chinese automaker that is strongest in manufacturing low-cost subcompacts. But both companies declined to provide any details.

Switching to sodium could solve one of the biggest problems with lithium batteries, which put out much less electricity in freezing temperatures.

Because of chemical differences between sodium and lithium, a sodium battery loses less than a tenth of its power at very cold temperatures, according to battery chemistry experts.

“It is promising,” said Ouyang Chuying, the president of research and development at CATL. “Sodium has no resource limit.”

Li You contributed research. Jack Ewing contributed reporting from New York.