npm install @idyeah/diya
GitHub
Appearance
Color scheme

Choice

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.

Type
Size
Options
State
Choose your focus

Using Choice

A labeled group of radios for one choice, or checkboxes for several with multiple. The ref reaches the inputs: a callback ref gets each one, an object ref the first.

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

When to use

For two to six options that should all be visible: radios for one, checkboxes for several.

An on/off setting that applies at once? Switch. A lone yes or no sent with a form? Checkbox.

Accessibility

Native radios and checkboxes in a fieldset whose legend is the label, so the group is announced with each option.

Props

import { Choice } from '@idyeah/diya'Stable since 1.0.0

labelRequiredstring

Visible group label (the fieldset legend); also names the group for assistive tech. Hide it with hideLabel.

optionsRequiredChoiceOption[]

The choices, in display order.

disabledboolean

Disables every option in the group.

Default false

errorstring

Visible error message below the options; marks the group invalid while set.

helperTextstring

Visible hint below the options, announced with the group; error replaces it while set.

hideLabelboolean

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

Default false

multipleboolean

Single mode (the default): radios, leave unset or false. Multiple mode: checkboxes, any number chosen.

namestring

Form field name shared by the inputs; defaults to a generated id.

onBlurFocusEventHandler<HTMLInputElement>

Called when one of the inputs loses focus.

onChangeChangeEventHandler<HTMLInputElement>

Native change event from the radio or checkbox that changed, as react-hook-form's register() expects; onValueChange still fires.

requiredboolean

Asks the browser to require a choice before the form submits; radios only.

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

Control and type size; defaults to 'medium'.

Default 'medium'

When multiple={false} (the default)

defaultValuestring

The initially chosen value when uncontrolled; a form reset returns to it.

onValueChange(value: string) => void

Called with the chosen option's value.

valuestring

The chosen option's value, or '' for none, when controlled; pair it with onValueChange.

When multiple={true}

defaultValuestring[]

The initially chosen values when uncontrolled; a form reset returns to them.

onValueChange(value: string[]) => void

Called with the full new array of chosen values.

selectAllboolean

Adds a visible "Select all" checkbox first that toggles every enabled option and shows a mixed state when some are chosen.

valuestring[]

The chosen options' values, when controlled; pair it with onValueChange.

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