scrimba
Frontend Career Path
Advanced React
Reusability
Toggle.Display intro
Go Pro!Bootcamp

Bootcamp

Study group

Collaborate with peers in your dedicated #study-group channel.

Code reviews

Submit projects for review using the /review command in your #code-reviews channel

AboutCommentsNotes
Toggle.Display intro
Expand for more info
index.js
run
preview
console
import React from 'react';
import ReactDOM from 'react-dom/client';
import Menu from "./components/Menu/index"
import Star from "./components/Star"
import Toggle from "./components/Toggle/index"

function App() {
return (
<>
<Toggle>
<Toggle.Button>
<Toggle.On>
<div className="box filled"></div>
</Toggle.On>
<Toggle.Off>
<div className="box"></div>
</Toggle.Off>
</Toggle.Button>
</Toggle>
</>
)
}
// <Star />

// <br />

// <Menu>
// <Menu.Button>Menu</Menu.Button>
// <Menu.Dropdown>
// <Menu.Item>Home</Menu.Item>
// <Menu.Item>About</Menu.Item>
// <Menu.Item>Contact</Menu.Item>
// <Menu.Item>Blog</Menu.Item>
// </Menu.Dropdown>
// </Menu>

ReactDOM.createRoot(document.getElementById('root')).render(<App />);
Console
/index.html
-2:05