npm install @idyeah/diya
GitHub
Appearance
Color scheme

Checkbox

Get code

Three steps. The first two happen once per app.

Step 1: Install

Terminal, in your app’s folder
npm install @idyeah/diya

Once per app. Every component and pattern is in this one package.

Working in Claude Code or Cursor? Connect your editor once and it fetches this for you.

No app yet? npm create diya@latest sets up Next.js or Vite with the styles and provider already in place. Then skip to step 3.

Step 2: Add the styles and provider

Once, at your app’s root: app/layout.tsx in Next.js, src/main.tsx in Vite. DIYA Sans comes with it.

Root layout or entry
import '@idyeah/diya/styles.css'
import { DiyaProvider } from '@idyeah/diya'

<DiyaProvider theme="dark">
  {children}
</DiyaProvider>

theme="dark" matches the catalog as you’re viewing it. theme="system" follows each visitor’s light or dark setting instead.

Get theme

Your brand as one CSS file and a few props.

Brand
AaAaNeutral (DIYA default)
Font
DIYA Sans
Corners · Elevation
Soft · Soft
Control height · Fields
Default · Auto
Glass
Off
Motion
Match device
Status colors
DIYA defaults

Step 1: Save the theme file

diya-theme.css · 6 lines
/* diya-theme.css, made in the DIYA catalog.
   Import it after '@idyeah/diya/styles.css'. Public tokens only.
   Brand: Neutral (DIYA default). */

/* No color, corner or elevation changes: DIYA's defaults apply. */

Public tokens only: the names DIYA promises not to rename in 1.x.

Step 2: Import it after DIYA’s styles

Root layout or entry
import '@idyeah/diya/styles.css'
import './diya-theme.css'

Order matters. The theme goes second so it wins.

Size
Options
State

You can read them any time from your account.

Using Checkbox

A lone yes-or-no box sent with a form, such as agreeing to terms, with a label and optional helper text or error.

A Markdown brief for Claude, Cursor or v0: install, setup, props and a complete example.

When to use

For a lone yes or no sent with a form: agreeing to terms, keeping someone signed in. Switch acts now. Checkbox is a yes or no you send with a form. Choice picks from a list.

A setting that takes effect the moment it flips? Switch. Several options under one question? Choice.

Accessibility

A native checkbox, so Space toggles it. The label names it, helper text and errors are linked to it, and an error sets aria-invalid. The mixed state is announced as mixed.

Props

import { Checkbox } from '@idyeah/diya'Stable since 1.2.0

labelRequiredReactNode

Visible statement beside the box, in the reader's voice ("I agree to the Terms"); also its accessible name. It can hold inline TextLinks, which open without toggling the box. Hide it with hideLabel.

checkedboolean

Whether the box is checked, when controlled; pair it with onCheckedChange.

defaultCheckedboolean

Whether the box starts checked when uncontrolled; a form reset returns to it.

disabledboolean

Prevents toggling and dims the field.

Default false

errorstring

Visible error message below the label; marks the box invalid while set.

helperTextstring

Visible hint below the label, announced with the box; error replaces it while set.

hideLabelboolean

Hides the label visually but keeps it as the box's accessible name.

Default false

indeterminateboolean

Shows a dash for "some chosen" and is announced as mixed; checked is set aside while it's on, so a click reports true. Use it for a box that chooses all of a list of your own. Defaults to false.

Default false

onCheckedChange(checked: boolean) => void

Called with the new checked state when the box is toggled.

size"small" | "medium" | "large"

Box and type size; defaults to 'medium'.

Default 'medium'

valuestring

The value sent with the form under name while the box is checked; "on" when left out, as for a native checkbox. Left out, react-hook-form's register() reads the field as true or false.

Also takes every native <input> attribute, such as name, id or data-*.