Skip to content
Menu

Buttons

Latching icon toggle

Latching icon toggle: A square button that latches on and off: a filled plate fades in, the glyph swaps for its matched counterpart, and a caption beside it spells the state out in words.

Using Latching icon toggle

Latching icon toggle uses the inline preview frame with a light/dark theme setting.

Customize the preview

These controls are passed to the demo. Defaults and limits describe the preview; consult the implementation for its full prop API.

ControlTypeDefaultPreview limits
glyphselectnotificationsOptions: notifications, sound, pin
startPressedbooleanfalseNo additional limit in the metadata.
accentcolor#FF6A1FNo additional limit in the metadata.
sizenumber40From 28 to 56; step 2
showCaptionbooleantrueNo additional limit in the metadata.
Which frameworks are available for Latching icon toggle?

Latching icon toggle is available for React, Vue, Svelte, Astro, HTML. The live preview uses React; the source observations below apply to index.tsx. Check the selected port before relying on the same interactions.

What does Latching icon toggle depend on?

The React metadata lists these npm dependencies beyond React: motion, clsx, tailwind-merge.

What accessibility details are visible in Latching icon toggle?

The React source for Latching icon toggle includes: attributes and handlers (aria-hidden, aria-label, aria-pressed). These are source observations. Verify accessible names, focus order and keyboard behavior in the composed page.

How does Latching icon toggle handle reduced motion?

Latching icon toggle reads the motion preference in its React source through useReducedMotion(). Preference-dependent expressions in index.tsx: fadeTransition: calm ? { duration: 0 } : { duration: 0.2, ease: [0.2, 0.8, 0.2, 1] as const }; springTransition: calm ? { duration: 0 } : { type: "spring" as const, stiffness: 460, damping: 28 }. Check the full implementation, shared styles and selected port with reduced motion enabled; these observations do not establish that every animation stops.

Connect your agent

Related open components