structyl

Rating API

View component

The full prop reference for the Rating component. Collects a numeric star rating.

Import

tsx
import { Rating } from '@structyl/styled';

Props

Rating

Star rating input.

PropTypeDefault
value | defaultValue#number

Controlled or uncontrolled rating value.

onValueChange#(value: number) => void

Called when value changes.

max#number

Number of rating items.

5
disabled | readOnly#boolean

Interaction state.

false
name#string

Hidden input name for forms.

size#'small' | 'medium' | 'large'

Star size.

'medium'
color#'default' | 'primary' | 'success' | 'warning' | 'destructive' | 'muted'

Checked item color.

'primary'
icon | emptyIcon#React.ReactNode

Custom checked and unchecked visuals.

getLabelText#(value: number) => string

Accessible label generator.

precision#number

Documented precision marker for design parity.

className#string

Additional Tailwind classes merged with the component defaults.

Source code

If you didn't find what you need here, read the component implementation .

structyl — Accessible React Component Library