Walmart is taking aggressive steps to fill the void left by Toys 'R' Us.

Sensing an opportunity to appeal to shoppers and grab market share, the world's largest retailer is expanding its toy selection in stores and online as it gears up for the first holiday season without Toys 'R' Us in decades.

Walmart (WMT) announced on Thursday that it plans to increase its new toy selection in all stores by 30% and expand its website assortment by 40%.

It is bringing hundreds of exclusive brands to aisles and holding in-store toy demos. Walmart is also partnering with Ryan, a first-grade YouTube star, on "Ryan's World" — a line of toys he recommends.

Walmart is gunning for a big chunk of the $7 billion in sales Toys and Babies 'R' Us left behind when they shut down more than 800 stores in bankruptcy.

"We are making even bigger investments in the category to ensure we have the widest selection," Anne Marie Kehoe, Walmart's US vice president of toys, said in a news release.

The retailer has already announced a redesigned nursery page on its website and added new car seats and strollers to its collection.

Rivals are stepping their efforts to improve their toy and baby lineup, too.

JCPenney (JCP) and Kohl's (KSS) have announced plans to enhance their offerings in recent weeks. Party City expects to open around 50 toy pop up stores.

Toys are a hot gift thanks to Toys 'R' Us. Toy sales grew 7% during the first half of the year, market research firm NPD Group found.

"It is likely that the Toys 'R' Us news has kept toys top-of-mind for parents and grandparents when shopping for kids," said Juli Lennett, a senior vice president and industry advisor for toys at NPD Group.

Walmart could be in a strong position to capitalize on Toys 'R' Us' collapse.

Retail think tank Coresight Research has found that Walmart and Target shoppers have the biggest overlap with former Toys 'R' Us shoppers.

Target (TGT) merchants have been buying up extra toys, and the retailer reported double-digit sales growth in the category last quarter compared to a year ago.

"Given the strong affinity between families with young children and our brand, both toys and [baby] are key categories for us," Target CEO Brian Cornell told analysts last week. He said Toys 'R' Us closures created "unique opportunities" to drive traffic and capture market share.

Amazon (AMZN) has also been making a heavy push on toys. Amazon released its top 100 toy list on Wednesday, 10 days earlier than last year.

"Amazon is gearing up to take disproportionate share this holiday season," Jefferies analyst Stephanie Wissink said in a report.

Wissink believes Amazon will send toy catalogs to Amazon Prime homes and Whole Foods soon, and may use the catalog to offer non-Prime members free trials during the holidays.

—Clarification: This story has been updated to reflect Walmart's plan to increase its new toy selection in all stores by 30%.