Checkbox

Checkbox with label, description text, error state, and three sizes.

Preview

Live previewCustomize theme
ONE GOOD STEP AT A TIME

A launch worth checking off.

2 of 4 complete50%

A lighter touch.

Import

tsx
import { Checkbox } from '@velocityuikit/velocityui'

Props

PropTypeDefaultDescription
variant'default' | 'card''default'Use card for a full clickable selection surface with a checked outline. Works with native checked/defaultChecked and form behavior.
labelstring—Label text rendered beside the checkbox.
descriptionstring—Helper text rendered below the label.
errorstring—Error message rendered below. Sets aria-invalid.
size'sm' | 'md' | 'lg''md'Controls the checkbox and label size.
checkedboolean—Controlled checked state.
defaultCheckedboolean—Uncontrolled default checked state.
disabledbooleanfalseDisables the checkbox.

Examples

Basic

tsx
import { Checkbox } from '@velocityuikit/velocityui'

export default function Example() {
  return <Checkbox label="Accept terms and conditions" />
}

With description

tsx
import { Checkbox } from '@velocityuikit/velocityui'

export default function Example() {
  return (
    <Checkbox
      label="Email notifications"
      description="Receive updates about your account activity."
      defaultChecked
    />
  )
}

Sizes

tsx
import { Checkbox } from '@velocityuikit/velocityui'

export default function Example() {
  return (
    <div style={{ display: 'flex', flexDirection: 'column', gap: '0.75rem' }}>
      <Checkbox size="sm" label="Small" defaultChecked />
      <Checkbox size="md" label="Medium" defaultChecked />
      <Checkbox size="lg" label="Large" defaultChecked />
    </div>
  )
}

Theming

Apply a named theme class to <body> or any parent element. All VelocityUI components inside that element will automatically adopt its colors, shadows, and effects. Combine with a density modifier for complete control:

html
/* Pick any named theme */
<body class="vui-theme-ocean">

/* Add a density modifier (optional) */
<body class="vui-theme-midnight vui-density-compact">
<body class="vui-theme-construction vui-density-spacious">

/* Available themes */
/* default  midnight  ocean  dark-cyan  tangerine */
/* construction  glass  soft  high-contrast  monochrome-red */

/* Available densities */
/* vui-density-compact  vui-density-comfortable  vui-density-spacious */