Skip to content

feat(rating): add Rating, a star rating to tap or drag, plus showcase screens for it and OtpField - #85

Merged
elik56a merged 2 commits into
masterfrom
feat/rating
Oct 29, 2026
Merged

elik56a merged 2 commits into
masterfrom
feat/rating

Conversation

@eliyahu-kriel

Copy link
Copy Markdown
Collaborator

Rating

A star rating: tap a star, or drag across the row and let go.

  • value / onChange, max (5), step (1; 0.5 for half stars). A drag previews the value and commits once on release. On the web the pointer previews the rating a click would pick.
  • readOnly shows any fraction, e.g. 4.3 fills part of the fifth star, and takes no touches.
  • Stars are a ★ character, so there's no SVG. renderIcon draws any icon, empty and filled, cut to the value. color is gold by default and emptyColor is the theme's border colour.
  • One adjustable control for screen readers. Arrow keys step it, and Home/End go to 0 and max. Works in RTL.
  • The row stretches with its parent like any View and ignores taps after the last star.
  • useRating returns a named RatingState, so the declaration build can emit it.

Slider's private rounding helpers moved to core/utils/track.utils.ts, so Slider and Rating share them. Slider's behaviour is unchanged.

Docs and site

  • Component page with live examples and a playground (no platform switch, since every design looks the same), plus migration guides from react-native-ratings and react-native-star-rating-widget. Everything on the AGENTS.md sync list is updated.
  • The prop playground's stage is now a flex column, like the live examples, so a component can centre itself with alignSelf.
  • Two new showcase screens: Verify your phone (PhoneField and OtpField) and Rate your stay (Rating).
  • Separate commit: the versions menu now lists only the built versions plus one "Older versions" link to the GitHub tags, instead of every line back to v0.9.

Checks

  • pnpm lint, pnpm typecheck, pnpm build, pnpm test (709 tests) and pnpm docs:build all pass.
  • Not checked in a browser or on a device yet.

🤖 Generated with Claude Code

elik56a and others added 2 commits October 29, 2026 23:08
… screens for it and OtpField

Rating picks a score by tapping a star or dragging across the row: whole or
half steps, previewed while dragging and committed on release, and on the web
the pointer previews the value a click would pick. readOnly shows any
fraction, filling part of a star. Stars are a ★ character, so there's no SVG;
renderIcon draws any icon, empty and filled, cut to the value. The row is one
adjustable control for screen readers, steps with arrow keys, handles RTL,
and ignores taps in the empty row after the last star.

The slider's rounding helpers move to core, shared with Rating. Migration
guides cover react-native-ratings and react-native-star-rating-widget. The
prop playground's stage is laid out as a flex column, like the live examples,
so a component can centre itself. The showcase gains "Verify your phone"
(PhoneField and OtpField) and "Rate your stay".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… older ones

The menu listed every old release line, back to v0.9, each linking to its docs
on GitHub. Older lines now share one "Older versions" link to the repo's tags,
so the menu is Next, the built versions, Older versions, Changelog and GitHub
releases. prepare.mts no longer writes archived-versions.json.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@elik56a
elik56a merged commit d8ba390 into master Oct 29, 2026
5 checks passed
@github-actions github-actions Bot mentioned this pull request Oct 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants