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.
| Control | Type | Default | Preview limits |
|---|---|---|---|
glyph | select | notifications | Options: notifications, sound, pin |
startPressed | boolean | false | No additional limit in the metadata. |
accent | color | #FF6A1F | No additional limit in the metadata. |
size | number | 40 | From 28 to 56; step 2 |
showCaption | boolean | true | No 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.