Toggle Group
A set of toggles, single or multiple.
Import
tsx
import { ToggleGroup } from "@cronus-ui/ui";
bash
npx cronus-ui add toggle-group
Examples
.cronus
The same component declared in Cronus. Emitted at build time from the audit fixtures — the kernel renders it as HTML with no React.
default.cronus
app "audit-fixtures" {
port 5176
}
style {
preset aurora
theme dark
}
component ToggleGroupDefault layout:inline style:toggle-group {
value:"Day"
aria-label:"Range"
label "Range"
text "Day"
text "Week"
}
page "/audit/toggle-group/default" type:custom {
use ToggleGroupDefault
}
API Reference
Generated from the component's exported types.
ToggleGroupProps
Extends ComponentPropsWithoutRef<typeof ToggleGroupPrimitive.Root>
| Prop | Type | Default | Description |
|---|---|---|---|
type | "single" | "multiple" | — | Whether one or many items can be pressed. |
value | string | — | Controlled value. |
defaultValue | string | — | Uncontrolled initial value. |
onValueChange | (value: string) => void | — | Called when the value changes. |
disabled | boolean | — | Disables pointer and keyboard interaction. |
orientation | "horizontal" | "vertical" | — | — |
dir | "ltr" | "rtl" | — | Reading direction. Inherits from the document when omitted. |
loop | boolean | — | When true, keyboard navigation wraps around the ends. |
ToggleGroupItemProps
Extends ComponentPropsWithoutRef<typeof ToggleGroupPrimitive.Item>
| Prop | Type | Default | Description |
|---|---|---|---|
value | string | — | Controlled value. |
disabled | boolean | — | Disables pointer and keyboard interaction. |
asChild | boolean | — | Render as the child element via Slot. |