Knit UI
GitHub

Playground

Loading playground…

false
false
true
Playground
<Checkbox
  label="Accept terms and conditions"
  variant="filled"
  size="sm"
  disabled={false}
  indeterminate={false}
  readOnly
/>

Examples

Variants

Both visual variants at the default size, checked and unchecked.

Loading example…

VariantsSourceStorybook

Sizes

Full seven-step size scale.

Loading example…

SizesSourceStorybook

Disabled

Disabled state — the box is dimmed and cannot be toggled.

Loading example…

DisabledSourceStorybook

Indeterminate

Indeterminate state — aria-checked is "mixed" to indicate partial selection.

Loading example…

IndeterminateSourceStorybook

With Label And Description

Label, description and error message rendered together.

Loading example…

With Label And DescriptionSourceStorybook

Controlled

Controlled — checked state is owned by the parent; prints current value below.

Loading example…

ControlledSourceStorybook

Read Only

Read-only — the value is visible but cannot be changed.

Loading example…

Read OnlySourceStorybook

Group

Checkbox.Group manages an array of selected values across multiple checkboxes.

Loading example…

GroupSourceStorybook

Group Max Values

Checkbox.Group with a maximum number of selections enforced.

Loading example…

Group Max ValuesSourceStorybook

Card

Checkbox.Card renders a pressable card that functions as a checkbox.

Loading example…

CardSourceStorybook

Card Shadows

Checkbox.Card with the shadow elevation prop across the shadow ladder.

Loading example…

Card ShadowsSourceStorybook

Indicator

Checkbox.Indicator is a presentational-only box with no press handler.

Loading example…

IndicatorSourceStorybook

Themes

Accent themes use Tamagui theme, not a public color prop.

Loading example…

ThemesSourceStorybook

Matrix

Full variant × size matrix for visual regression.

Loading example…

MatrixSourceStorybook

Styles

Per-slot styles targets individual parts — here the box square and the label.

Loading example…

StylesSourceStorybook

Props

PropTypeDefaultDescription
aria-describedbystring | undefinedExtra element id(s) to merge into the control's `aria-describedby`.
checkedboolean | undefinedControlled checked state.
defaultCheckedboolean | undefinedfalseInitial checked state for the uncontrolled case.
descriptionReactNodeDescription rendered below the label.
disabled systemboolean | undefinedfalseDisables the checkbox.
errorReactNodeError rendered below the description (string nodes get the error theme).
iconCheckboxIconComponent | undefinedIcon component for the checked / indeterminate state.
iconColorGetThemeValueForKey<"color"> | OpaqueColorValue | undefinedOverride the icon colour (defaults to the contrast/accent colour).
idstring | undefinedId used to bind the control and label; auto-generated when omitted.
indeterminateboolean | undefinedfalseIndeterminate state. When set, `checked` is ignored for display.
labelReactNodeAccept terms and conditionsLabel content rendered next to the control.
labelPosition"left" | "right" | undefined
left · right
'right'Position of the label relative to the checkbox box.
onChange((checked: boolean) => void) | undefinedCalled with the next checked state. Mirrors Mantine's `onChange` name; the payload is a boolean (not a DOM event) because the kit is cross-platform.
onCheckedChange((checked: boolean) => void) | undefined
radius systemstring | number | undefined
readOnlyboolean | undefinedfalseIf set, the value cannot be changed but the control stays focusable.
rootRefRef<TamaguiElement> | undefinedRef of the root wrapper element.
shadow system"xs" | "sm" | "md" | "lg" | "xl" | "xxs" | "xxl" | undefined
size system"xs" | "sm" | "md" | "lg" | "xl" | "xxs" | "xxl" | undefined
xxs · xs · sm · md · lg · xl · xxl
'md'Controls the box dimensions, icon size and label metrics.
styles systemSlotStyles<CheckboxStyles> | undefinedUniform per-slot style passthrough — sugar over the composable parts. Own slots: `box` (the square) / `icon` (the glyph); plus the inherited chrome slots `label` / `description` / `error` / `root` forwarded to the `InlineControl`.
theme systemThemeName | null | undefined
unset · blue · red · green · yellow · pink · gray
Accent theme applied to the checkbox box and icon.
valuestring | undefinedValue reported to a surrounding `Checkbox.Group`.
variant systemCheckboxVariant | undefined
filled · outline
'filled'Visual style — filled fills the box with the accent colour; outline tints the border and icon only.
withErrorStylesboolean | undefinedtrueApply error styles to the box when `error` is set.

Style slots

Every part of Checkbox can be styled through the styles prop. Explicit props on the component always win over slot styles.

SlotUsage
boxstyles={{ box: { … } }}
descriptionstyles={{ description: { … } }}
errorstyles={{ error: { … } }}
iconstyles={{ icon: { … } }}
labelstyles={{ label: { … } }}
rootstyles={{ root: { … } }}
Accessibility & DOM props (2)
PropType
keyKey | null | undefined
refRef<TamaguiElement> | undefined

Plus 496 inherited style props from Box — the full Tamagui/React Native style surface, including token shorthands like p, mx, bg and c. See Tokens for the scales they accept, or the full list.