npm install @idyeah/diya
GitHub
Appearance
Color scheme

Rating

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
  • Full marks
  • 4.3, shown as 4½
  • Half star
  • Not rated yet

Using Rating

A read-only star rating, with an optional number and review count, announced as one phrase such as "Rated 4.3 out of 5, 128 reviews".

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

When to use

For how people rated something, such as a product, a place or an app. Add the review count, so the stars carry their weight.

Asking people for a rating? Choice, with 1 to 5 as its options. A score that isn’t out of stars? Metric.

Accessibility

One image, named like "Rated 4.3 out of 5, 128 reviews"; the stars themselves are hidden. Stars fill to the nearest half, and the name keeps the exact value.

Props

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

valueRequirednumber

The rating, from 0 to max. Values outside that range are clamped, and one that isn't a number shows as 0. The stars fill to the nearest half (4.3 shows four and a half); the number and the accessible name keep one decimal.

countnumber

How many reviews the rating comes from, shown after the stars as '(128)' and announced as '128 reviews'. Leave it out to show the stars alone.

maxnumber

How many stars: a whole number from 1 to 10. Defaults to 5.

Default 5

showValueboolean

Shows the value as a number before the stars, such as '4.3'. Defaults to false.

Default false

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

Star and text size. Defaults to 'medium'.

Default 'medium'

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