HomeLabHire Me
ml-ui111 components

Get started

IntroductionInstallation

UI

Dots

Dot AccordionDot CalendarDot CheckboxDot CodeDot CommandDot ContentsDot CountdownDot CrossingDot FuseDot GaugeDot InstallDot KnobDot LogosDot MenuDot PaginationDot PasswordDot Price RangeDot PricingDot ProgressDot QueueDot RatingDot Reading ProgressDot SelectDot SignupDot SliderDot StatusDot StepperDot SwitchDot TabsDot ToastDot TooltipFlip-Dot CounterLED Marquee

Dither

Dither AvatarDither BannerDither CompareDither GlobeDither PortraitDither SkeletonDither TrailDither UploadDot CookiesDot DialogDot KeysDot ReceiptDot VariantsLenticular Card

More

Pollen TrailSplit-FlapTheme Toggle

Text

Dither RotatorDot TypeEnigma TextInk Print

Data viz

Dots

Contribution FieldDot BarsDot ChartDot Waffle

Dither

Dither DensityDither MapDither Stack

Media

Dots

Dot EqualizerDot WaveformVoice Note

Dither

Dither Scrubber

AI

Agent StepsAnswer VersionsCitation ChipConfidence GlassContext MeterDiffusion ImageDiffusion TextDither MaskDoc ReaderDot DictationGenerate ButtonGhost TextModel PickerPrompt BarResponse ActionsRevising TextSpoken ReplyThinking OrbThinking TraceToken MeterToken StreamWord Alternatives

Useful

Arrival TimeBest ShotCareer LineForgiving SearchGesture PadHeard AsHonest PinImage PaletteLikeness GridNear Miss SearchRain DropsSoft CorrectSpending SortSticker LiftTaste Ledger

Backgrounds

ButterfliesDandelionsDuck PondFirefliesKoi PondLight WellMarigoldsTrain WindowWhite Blossom

ml-ui / UI

Dot Rating

Stars light up to the rating, and a part-filled one (an average of 4.3, say) is lit to exactly its share, its edge a dithered stipple. Hovering previews a rating, halves too if you allow them, and picking one throws a small burst of dots off the star. It's a slider to screen readers and the keyboard: arrows, Home and End, or a number key for that many stars. Read-only, it shows an average.

Needs: None. Canvas 2D.

Customize

step

Props

PropTypeDefaultDescription
valuenumber–The rating. Leave unset to let it keep its own.
defaultValuenumber0The rating at first, when value isn't set.
onChange(value: number) => void–Called with the new rating when one is picked.
maxnumber5How many stars.
step0.5 | 11Whole stars, or halves too.
readOnlybooleanfalseShow a rating, like an average, without taking one.
tonestring"#f2a531"The colour of a lit star.
pitchnumber4Size of one dot in px. A star is 9 dots wide.
labelstring"Rating"What's being rated, for screen readers.
classNamestring–Class on the rating.
styleCSSProperties–Style on the rating.
← Dot QueueDot Reading Progress →