Toggle
A glass button that stays pressed.
Installation#
pnpmnpmyarnbun
$ pnpm dlx shadcn@latest add @liquikit/toggleNeeds the @liquikit registry in your components.json. Set it up once.
Usage#
import { Toggle } from "@/components/liquikit/toggle"<Toggle defaultPressed>Wi-Fi</Toggle>Examples#
Icons#
API Reference#
Toggle
| Prop | Type | Default |
|---|---|---|
theme | "light" | "dark"Light or dark glass. Falls back to the nearest | — |
lens | Partial<LensProfile>Overrides for the lens profile, such as | — |
liquid | numberHow far the glass squashes and stretches as it moves. | — |
size | "small" | "regular" | "large"Height and padding of the toggle. | "regular" |
icon | booleanMakes the toggle square, for a single icon. | — |
tint | stringColour of the glass when pressed. | — |
variant | "glass" | "clear"
| "glass" |
refraction | "interactive" | "always"When the glass bends the page. | "interactive" |
children | ReactNodeThe content. | — |
Also takes every prop of Base UI's toggle, plus className and style.