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";- 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.
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).
import { Star } from "@nexera-ui/react";
const sizes = ["sm", "md", "lg"] as const;
export function RightToLeft() {
return (
<div className="flex items-center gap-4">
{sizes.map((size) => (
<Star key={size} fill="half" size={size} />
))}
</div>
);
}
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).
sizeNexera"sm" | "md" | "lg"Size: 16, 24 or 32 px.
* 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.
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:.
<Star className="shadow-sm" />Used in blocks
No block uses Star yet.
Related components
- CalendarDayOne day of a {@link CalendarMonth } grid, built on React Aria `CalendarCell`: a `gridcell` whose button is named by the full, localised date ("Wednesday, October 14, 2026"), with `aria-selected`, `aria-disabled` and the "today" and range descriptions read by screen readers (WCAG 1.3.1, 4.1.2).
- CalendarMonthA month calendar for picking a date or a date range: header with previous / next buttons and the localised month name, weekday row, and six weeks of `CalendarDay`s.
- CheckboxThe bare 18 px checkbox: one independent yes/no choice applied on submit, or a row selector in a table, list or tree.
- CheckboxCardA large checkbox option with an icon, a title and a description, for a few options that need explanation (notification channels, benefits).
- CheckboxFieldA checkbox with a label and optional helper text: the box (the same element as `Checkbox`) followed by the label and description, applied on submit.
- ColorInputA hex colour field with a swatch and a picker popover.
- ColorPickerPicks a colour.
- ColorTokenCardDocumentation card for one colour token: a 96 px colour sample with an "Aa" text sample, then the name, token path, hex value and contrast note as text.