Theme studio

Design a theme, preview it live, then export it. Saved in this browser.

Quick picks #10b981
Generated scale
50100200300400500600700800900
Some text is below AA

Star

  • Stable
  • WCAG 2.2 evidence
  • RTL

One rating star, the building block of Rating, RatingInput and RatingSummary. Presentational: renders in React Server Components. Decorative by default (aria-hidden): the component that shows stars states the value in text (WCAG 1.1.1, 1.4.1). Give it an aria-label only when a single star carries meaning on its own; it then becomes an image with that name. Filled and empty stars differ in colour and in shape: an empty star keeps a border/input rim, because the Figma rating/inactive fill alone is 1.47:1 on the surface (WCAG 1.4.11, known token exception).

import { Star } from "@nexera-ui/react";
Loading example…
2
examples
2
props
2
live controls
1
platform
5
WCAG criteria
0
blocks use it

Try every prop. Copy the code.

Change the props and the code updates. Check light and dark, LTR and RTL, and phone width.

Loading…
fill
size
Generated code
import { Star } from "@nexera-ui/react";

<Star />

Examples 1

The same examples as Storybook, rendered live. Open Code to copy one.

Right to left

Right-to-left: the half star fills from the inline start (the right).

Loading example…

Props 2

Press "Try it" on a card to load that prop into the playground.

2 props shown

fillNexera
"full" | "half" | "empty"

How much of the star is filled. half fills the inline-start half (the right half in right-to-left layouts).

Default full
sizeNexera
"sm" | "md" | "lg"

Size: 16, 24 or 32 px.

Default sm

* Required. React Aria props shown are the ones most apps use; the component accepts the rest of its React Aria props too.

Accessible by default.

Built on React Aria, and covered by the WCAG 2.2 evidence generated on every build.

WCAG 2.2 evidence

2 direct · 3 supporting
  • 1.1.1Non-text ContentLevel A · tested directly
  • 1.3.2Meaningful SequenceLevel A · supporting test
  • 1.4.1Use of ColorLevel A · supporting test
  • 1.4.11Non-text ContrastLevel AA · supporting test
  • 4.1.2Name, Role, ValueLevel A · tested directly

Fits any width.

Nexera components respond to the space they are given. Drag the corner of the frame, or pick a width.

0 px · drag the corner

Styling hooks

Pass className to add Tailwind classes (merged last). State is exposed as data attributes, so you can style it with variants like data-pressed:.

Usage
<Star className="shadow-sm" />

Used in blocks

No block uses Star yet.

Related components