<Toggle>
ComponentA simple toggle, used primarily in consent manager.
<Toggle />
Name | Description |
---|---|
enabled boolean | Whether the toggle is on or off |
onChange function | Function that will be called when the toggle is changed to on or off |
You can pass the enabled
prop in to toggle.
<Toggle enabled />
You can also pass the onChange
function to react when the toggle changes state
<Toggle onChange={() => console.log('toggle changed')} />
Appearance set to dark
<div style={{ padding: 32, background: 'black' }}><Toggle appearance="dark" /></div>