Skip to main content

Tabs

getContent renders the page, in this case <h1>{page}</h1>.

On mobile phones it renders a dropdown instead. This does not work properly on Storybook.

Live Editor
function TabsExample() {
	const pages = ["Page 1", "Page 2", "Page 3"];
	// Creating this function here is actually bad practise
	function getContent(page) {
		return <h1>{page}</h1>;
	}

	return <Tabs pages={pages} getContent={getContent} />;
}
Result
Loading...