toggle
Pressable on/off button following the WAI-ARIA button pattern.
A headless toggle button — a button with aria-pressed and data-state
(on / off). Controlled or uncontrolled.
Installation
pnpm add @fluixi/toggle
Usage
import { Toggle } from '@fluixi/toggle';
<Toggle defaultPressed onChange={setPressed}>Bold</Toggle>
<Toggle pressed={bold()} onChange={setBold}><BoldIcon /></Toggle>
pressed/defaultPressed/onChangefor controlled/uncontrolled state.disabledsuppresses toggle;aria-pressedanddata-stateare always accurate.
Part of the Fluixi UI component library. Made with ☕ by the Fluixi team.