Skip to content
ghostui

Preview

Design guidance

Rating uses Base UI's radio group and hidden native radio inputs. Tab enters the group, Arrow keys move between options, and Space selects. Hover previews glyph fill without committing the value. Provide a clear group label with aria-label or an owning Field. Use readOnly for review states and disabled when the answer cannot be changed.

Installation

Install

Basic usage

Structures

Examples

Basic star

Choose one of five scores. Stars fill through the selected value.

Number

Choose a score from one to five.

Custom icon

Use a custom icon for each score and caller-owned response text.

Emoji

Choose the face that best matches your response.

NPS 0–10

Zero is a real answer. Leave the group unanswered with value={null} when no response exists.

Not at all likelyExtremely likely

Seven-point linear scale

Choose confidence from one to seven.

Not confidentVery confident

Five-point opinion scale

Rate agreement with a statement from one to five.

Strongly disagreeStrongly agree

CSAT satisfaction emoji

Choose a satisfaction emoji. Hover or focus to see its meaning in a tooltip.

Half star

Choose half-point scores. Each half has its own accessible radio value and keyboard stop.

Half custom icon

Use the same half-point behavior with a caller-owned icon.

Visible description

Descriptions appear in a Tooltip by default. Set showDescription to keep feedback visible beside the choices on larger screens and below them on small screens.

Okay

Outlined choices

Add a subtle boundary to each number or emoji. Selection keeps its small inner surface.

API reference

The ref points to the outer div. RadioGroup attributes and events are forwarded to the group. Explicit empty options render no answers. Unknown values remain unanswered. Labels and business validation belong to the caller.