Toy giant Hasbro has approached Mattel about a potential takeover, CNBC confirmed, in a deal that could put brands such as Barbie and Transformers under the same roof.

Shares of Mattel surged nearly 20 percent on Monday, while shares of Hasbro rose 7.5 percent.

The talks were first reported Friday by The Wall Street Journal, citing unnamed sources.

Terms of a deal were unclear and it still may not materialize. If a deal were consummated, it would bring together the two largest U.S. toymakers. Mattel has a market value of $5 billion, while Hasbro is worth about $11 billion.

The offer takes place against the backdrop of an industry in the throes of deep change. The bankruptcy filing of Toys R Us, the children's store giant, has reverberated across the industry.

Hasbro owns brands such as Nerf, Transformers and My Little Pony. Mattel makes Barbie and American Girl dolls as well as Fisher-Price and Hot Wheels toys.

Both companies declined CNBC's request for comment.

— CNBC's David Faber contributed reporting.