Tangible Design System · @tangible/ui 0.2.29 · Interactive version · Markdown

Rating

import { Rating } from '@tangible/ui';

Interactive docs and examples: Rating in Storybook.

Rating props

Prop Type Default Description
allowClear? boolean Allow clicking the current selection to clear back to 0
aria-label? string Accessible label for the rating group. Defaults to "Rating: X of Y"
className? string
defaultValue? number 0 Uncontrolled initial value
disabled? boolean Disable interaction (keeps semantics)
gap? string Gap override (e.g. '0.25rem') – otherwise uses density utilities
labels? RatingLabels Override default English strings for i18n.
max? number 5 Maximum icons shown
name? string Name for the radio group (if you care about form posts)
onValueChange? (value: number) => void Called when the value changes
readOnly? boolean Presentational readOnly (no form semantics)
size? "lg" | "md" | "sm" 'lg' Size maps to icon + spacing
theme? "danger" | "primary" | "secondary" | "success" | "warning" 'secondary' Theme feeds foreground color tokens
value? number Controlled value (1..max). Use with onValueChange

Examples

Other stories: Basic, Sizes, Themed, Controlled, Read Only, Custom Max (interactive page).

Component API tokens

Read via fallback, never declared. Set one on an ancestor to restyle every instance under it.