Switch
An on and off switch.
An on and off switch.
npm install @heroui/react
First time with HeroUI? Set it up once.
/**
* Demo from HeroUI, https://heroui.com (docs example switch/basic.tsx).
* Apache-2.0, Copyright 2025 NextUI Inc. Full text: https://github.com/heroui-inc/heroui/blob/main/LICENSE
* Changed for Tastebud: a default export (HeroUI's docs use named ones) without the docs site's prop
* controls.
*/
import {Switch} from "@heroui/react";
export default function SwitchDemo() {
return (
<Switch>
<Switch.Content>
<Switch.Control>
<Switch.Thumb />
</Switch.Control>
Enable notifications
</Switch.Content>
</Switch>
);
}
Changed for this site: A default export (HeroUI's docs use named ones) without the docs site's prop controls.