Toggle

A glass button that stays pressed.

Installation#

pnpmnpmyarnbun
$ pnpm dlx shadcn@latest add @liquikit/toggle

Needs 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

PropTypeDefault
theme"light" | "dark"

Light or dark glass. Falls back to the nearest GlassThemeProvider, then light.

—
lensPartial<LensProfile>

Overrides for the lens profile, such as thickness, bevel, ior and magnification.

—
liquidnumber

How far the glass squashes and stretches as it moves. 0 keeps it rigid.

—
size"small" | "regular" | "large"

Height and padding of the toggle.

"regular"
iconboolean

Makes the toggle square, for a single icon.

—
tintstring

Colour of the glass when pressed.

—
variant"glass" | "clear"

glass is frosted glass, clear has no body until pressed.

"glass"
refraction"interactive" | "always"

When the glass bends the page. interactive bends it while the component is pressed, dragged or focused, always bends it all the time.

"interactive"
childrenReactNode

The content.

—

Also takes every prop of Base UI's toggle, plus className and style.