Stylish Rating
A star rating selector for choosing a value from 1 to max stars.
Renders a row of max star icons; the first value stars are tinted with filledColor and the rest with emptyColor. Tapping the n-th star calls onValueChange with n. The value is hoisted — the caller owns the state — so the rating never changes itself.
Each star is announced as a radio button via semantics with selected set per star, and the row carries a contentDescription summarizing the rating (e.g. 評価 3 / 5), matching the web rating-group accessibility pattern. When enabled is false the stars reject pointer input and are announced as disabled.
The star row follows the web focus-visible pattern: when a star is focused (keyboard navigation), a focus ring (see Modifier.stylishFocusRing) is drawn around that star. The rating uses no animation, so reduced-motion settings need no special handling.
Testing
The root carries the default test tag stylish_rating for UI tests. Callers can override it by passing their own Modifier.testTag(...) in modifier.
Parameters
The current rating between 0 and max. Values outside the range are coerced for display.
Called with the new rating (1-based) when a star is tapped.
Modifier applied to the Row root.
The number of stars displayed. Defaults to 5.
When false, the stars reject pointer input and are announced as disabled.
The edge length of each star's touch target. Defaults to 28.dp.
Tint of stars at or below value. Defaults to MaterialTheme.colorScheme.primary.
Tint of stars above value. Defaults to MaterialTheme.colorScheme.surfaceVariant.
The MutableInteractionSource shared by all stars, used to observe focus interactions (driving the focus ring). When null, an internal one is remembered.