XiodUI
HomeDocs
OverviewComponentsStyling & CustomizationChangelog

Components

  • Accordion
  • Agent Steps
  • Alert
  • Alert Dialog
  • Aspect Ratio
  • Autocomplete
  • Avatar
  • Badge
  • Breadcrumb
  • Button
  • Button Group
  • Button Split
  • Calendar
  • Card
  • Carousel
  • Checkbox
  • Circular Progress
  • Collapsible
  • Color Picker
  • Combobox
  • Command
  • Context Menu
  • Copy To Clipboard
  • Corner Badge
  • Dashboard Grid
  • Date Picker
  • Dialog
  • Dot Matrix
  • Draggable
    Updated
  • Drawer
  • Empty
  • Field
  • Fieldset
  • File Upload
    Updated
  • Form
  • Frame
  • Gauge
  • Grid
  • Group
  • Input
  • Input Group
  • Input OTP
  • Input Payment
  • Input Phone
    Updated
  • Input Sensitive
  • Kbd
  • Kinetic Click
  • Label
  • List Box
    Updated
  • Loader
  • Marker
  • Menu
  • Menubar
  • Message
  • Meter
  • Morphic Toast
  • Navigation Menu
  • Number Field
  • Option Picker
  • Orb
  • Pagination
  • Popover
  • Preview Card
    Updated
  • Progress
  • Radio
  • Resizable
  • Ruler Picker
  • Scroll Area
  • Scroll Bar
  • Select
  • Separator
  • Sidebar
  • Skeleton
  • Slider
  • Sortable
  • Switch
  • Table
  • Tabs
  • Text
  • Textarea
  • Timeline
  • Toast
  • Toggle
  • Toggle Group
  • Toolbar
  • Tooltip
  • Waveform
  • Wheel Picker

Loading...

Preview Skeleton

Installation Skeleton

Usage Skeleton

API Reference Skeleton

Sponsors

Support the development of XiodUI and help us build the best component library on Earth.

+++
Sponsor on GitHub

Toggle Group

Previous: ToggleNext: Toolbar

A set of toggle buttons where one or several can be pressed.

Preview

Loading Preview...

Installation

bun add xiod-ui

Usage

Imports

1import { ToggleGroup, ToggleGroupSeparator } from "xiod-ui/toggle-group";

API Reference

Detailed documentation of properties and options.

ToggleGroup

Accepts className, style and render, plus every native attribute of the element it renders.

PropTypeDefaultDescription
defaultValue
readonly string[]
–

The pressed state of the toggle group represented by an array of the values of all pressed toggle buttons. This is the uncontrolled counterpart of value.

disabled
boolean
false

Whether the toggle group should ignore user interaction.

loopFocus

ToggleGroupSeparator

Accepts className, style and render, plus every native attribute of the element it renders.

PropTypeDefaultDescription
orientation
"horizontal"|"vertical"
'horizontal'

The orientation of the separator.

ToggleToolbar
boolean
true

Whether to loop keyboard focus back to the first item when the end of the list is reached while using the arrow keys.

multiple
boolean
false

When false only one item in the group can be pressed. If any item in the group becomes pressed, the others will become unpressed. When true multiple items can be pressed.

onValueChange
((groupValue: Value[], eventDetails: ToggleGroup.ChangeEventDetails) => void)
–

Callback fired when the pressed states of the toggle group changes.

orientation
"horizontal"|"vertical"
'horizontal'

Whether the items are laid out horizontally or vertically.

size
"lg"|"sm"|"default"
default

The size of the component.

value
readonly string[]
–

The pressed state of the toggle group represented by an array of the values of all pressed toggle buttons. This is the controlled counterpart of defaultValue.

variant
"default"|"outline"
default

The visual style of the component.