Skip to content

Toggle

Two-state pressable.

Terminal window
npx github:truongnat/rnui#cli add toggle

or directly via the shadcn CLI:

Terminal window
npx shadcn add https://<registry-base>/r/nativewind/toggle.json # or /uniwind/

npm dependencies installed automatically: tailwind-variants

const [pressed, setPressed] = useState(false);
<Toggle pressed={pressed} onPressedChange={setPressed}>
<Text>Toggle</Text>
</Toggle>
  • components/ui/toggle.tsx

Installs together with: utils, theme