Skip to content
nexubDesign System
v12.7.0

Components · Interactive

Rating

StableAdded v0.0.1

Star rating input, supports controlled and read-only modes.

import { Rating } from '@nexub/react';
View as Markdown

Playground

Props

size
TSX
<Rating value={val} onValueChange={setVal} />

Examples

Default

Read-only

Sizes

States

  • default
  • readOnly
  • size="sm"
  • size="md"
  • size="lg"

Props

Props
PropTypeDefaultDescription
valuenumber—The controlled rating value.
maxnumber5Maximum number of stars.
readOnlybooleanfalsePrevents user interaction when true.
size'sm' | 'md' | 'lg''md'Size of the star icons.
onValueChange((value: number) => void)—Callback fired when the user selects a new rating.