Checkbox

Checked, unchecked and mixed, with the tick drawn on as it checks.

Features

  • Checked, unchecked and mixed.
  • The tick draws on as it checks.

Use it for

  • Forms and multi-select lists.

Installation

  1. Get runets.
    git clone https://github.com/ziyam-khan/runets
  2. Copy these files into your project, keeping their folders.
  3. Install what they use.
    pnpm add react @base-ui/react motion lucide-react
  4. Load the styles once. Bring your own base tokens, or use runets’ default theme.
    import 'runets/styles/theme.css'
    import 'runets/styles/kit.css'

Usage

import { Checkbox } from 'runets'

<Checkbox label="Remember me" checked={v} onCheckedChange={setV} />
<Checkbox label="Some files" indeterminate />

API

PropTypeWhat it does
checkedbooleanState.
indeterminatebooleanMixed state.
onCheckedChange(v) => voidCalled on change.
labelstringVisible label.

Accessibility

Source

The code is in src/kit/controls.tsx in runets, MIT licensed.