Toggle primitive for Fict, modeled after @radix-ui/react-toggle. A two-state button that can be on or off.
Part of ui-primitives, a port of Radix Primitives to Fict.
pnpm add @fictjs/toggle fict/** @jsxImportSource fict */
import * as Toggle from '@fictjs/toggle'
export function Example() {
return <Toggle.Root aria-label="Toggle italic">I</Toggle.Root>
}Toggle.Root(Root) —pressed/defaultPressed,onPressedChange,disabled. SupportsasChild.
Exposes data-state ("on" / "off") and data-disabled.
- Components:
Toggle(Root). - Types:
ToggleProps.
The API mirrors Radix, so the upstream Radix Toggle docs apply. See the ui-primitives overview and the architecture guide for the Fict-specific reactivity model.
MIT © Fict contributors.