Actions
Toggle
pressed two-state button
function ToggleDemo() { const [pressed, setPressed] = React.useState(false); return ( <Toggle variant="outline" className="self-start" aria-label="Toggle bold" pressed={pressed} onPressedChange={(next) => { Haptics.impactAsync(Haptics.ImpactFeedbackStyle.Light); setPressed(next); }}> <ToggleIcon as={BoldIcon} /> </Toggle> );}API
<Toggle pressed onPressedChange><ToggleIcon as={…} /></Toggle>Get it
Already in every copy of the native kit:
import { Toggle } from '@/components/ui/toggle';Details
- Exports
Toggle- Packages
- @rn-primitives/toggle@^1.5.2, class-variance-authority@^0.7.1
- Installs with
- @halftone-native/icon, @halftone-native/lib-utils, @halftone-native/text
- Also searched as
- pressed, two-state button
- Registry JSON
- /r/native/toggle.json
<Row> <Toggle aria-label="Bold"> <BoldIcon /> </Toggle> <Toggle aria-label="Italic" defaultPressed> <ItalicIcon /> </Toggle> <Toggle variant="outline" aria-label="Favourite"> <StarIcon /> Favourite </Toggle></Row>API
<Toggle pressed onPressedChange aria-label>…</Toggle>Get it
Already in every copy of the web kit:
import { Toggle, toggleVariants } from '@/components/ui/toggle';Details
- Exports
Toggle,toggleVariants- Also searched as
- pressed, favourite
- Upstream
- Unchanged from shadcn/ui; installs from their registry.
Agents: the whole registry is at /llms.txt.