XiodUI
HomeDocs
OverviewComponentsThemes & ColorsChangelog
⌘ K

Components

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

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

Checkbox

Previous: CarouselNext: Circular Progress

A control that allows the user to toggle between checked and not checked.

Preview

Loading Preview...

Installation

bun add xiod-ui

Usage

Imports

1import { Checkbox, CheckboxGroupItem, CheckboxGroup } from "xiod-ui/checkbox";

Anatomy

1<Checkbox>2  <CheckboxGroup>3    <CheckboxGroupItem />4  </CheckboxGroup>5</Checkbox>

API Reference

Detailed documentation of properties and options.

Checkbox

PropTypeDefaultDescription
id
string
|undefined
-The id of the input element.
name
string
|undefined
undefinedIdentifies the field when a form is submitted.
form
string
|undefined
-Identifies the form that owns the hidden input. Useful when the checkbox is rendered outside the form.
checked
boolean
|undefined
undefinedWhether the checkbox is currently ticked. To render an uncontrolled checkbox, use the `defaultChecked` prop instead.
defaultChecked
boolean
|undefined
falseWhether the checkbox is initially ticked. To render a controlled checkbox, use the `checked` prop instead.
disabled
boolean
|undefined
falseWhether the component should ignore user interaction.
onCheckedChange
((checked: boolean, eventDetails: { reason: "none"; event: Event; cancel: () => void; allowPropagation: () => void; isCanceled: boolean; isPropagationAllowed: boolean; trigger: Element
|undefined; }) => void)
|undefined
-Event handler called when the checkbox is ticked or unticked.
readOnly
boolean
|undefined
falseWhether the user should be unable to tick or untick the checkbox.
required
boolean
|undefined
falseWhether the user must tick the checkbox before submitting a form.
indeterminate
boolean
|undefined
falseWhether the checkbox is in a mixed state: neither ticked, nor unticked.
inputRef
Ref<HTMLInputElement>
|undefined
-A ref to access the hidden `<input>` element.
parent
boolean
|undefined
falseWhether the checkbox controls a group of child checkboxes. Must be used in a [Checkbox Group](https://base-ui.com/react/components/checkbox-group).
uncheckedValue
string
|undefined
-The value submitted with the form when the checkbox is unchecked. By default, unchecked checkboxes do not submit any value, matching native checkbox behavior.
value
string
|undefined
-The checkbox's value. Identifies it within a [Checkbox Group](https://base-ui.com/react/components/checkbox-group), falling back to `name` when omitted. When submitting a form, a checked box submits `value`; with no `value`, it submits the native "on".
nativeButton
boolean
|undefined
trueWhether the component renders a native `<button>` element when replacing it via the `render` prop. Set to `false` if the rendered element is not a button (for example, `<div>`).
style
CSSProperties
|((state: CheckboxRootState) => CSSProperties
|undefined)
|undefined
-Style applied to the element, or a function that returns a style object based on the component's state.
className
string
|((state: CheckboxRootState) => string
|undefined)
|undefined
-CSS class applied to the element, or a function that returns a class based on the component's state.
render
ReactElement<unknown, string
|JSXElementConstructor<any>>
|ComponentRenderFn<HTMLProps, CheckboxRootState>
|undefined
-Allows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a `ReactElement` or a function that returns the element to render.
variant
"default"
|"expressive"
|"sharp"
|"diamond"
|null
|undefined
default

CheckboxGroup

PropTypeDefaultDescription
value
string[]
|undefined
-Names of the checkboxes in the group that should be ticked. To render an uncontrolled checkbox group, use the `defaultValue` prop instead.
defaultValue
string[]
|undefined
-Names of the checkboxes in the group that should be initially ticked. To render a controlled checkbox group, use the `value` prop instead.
onValueChange
((value: string[], eventDetails: { reason: "none"; event: Event; cancel: () => void; allowPropagation: () => void; isCanceled: boolean; isPropagationAllowed: boolean; trigger: Element
|undefined; }) => void)
|undefined
-Event handler called when a checkbox in the group is ticked or unticked. Provides the new value as an argument.
allValues
string[]
|undefined
-Names of all checkboxes in the group. Use this when creating a parent checkbox.
disabled
boolean
|undefined
falseWhether the component should ignore user interaction.
className
string
|((state: CheckboxGroupState) => string
|undefined)
|undefined
-CSS class applied to the element, or a function that returns a class based on the component's state.
render
ReactElement<unknown, string
|JSXElementConstructor<any>>
|ComponentRenderFn<HTMLProps, CheckboxGroupState>
|undefined
-Allows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a `ReactElement` or a function that returns the element to render.
style
CSSProperties
|((state: CheckboxGroupState) => CSSProperties
|undefined)
|undefined
-Style applied to the element, or a function that returns a style object based on the component's state.
CarouselCircular Progress