App

Rating

Star rating on Base UI RadioGroup with hover preview and three sizes. Without a change handler, or when read-only, it renders as a labelled image of whole stars; star labels are translatable.

The source comes with full access.

One payment of $149 ($49 for now) opens the source right here and lets the CLI install every paid component, with lifetime updates.

Installation

pnpm dlx shadcn add @01orbital/rating
npx shadcn add @01orbital/rating
yarn shadcn add @01orbital/rating
bunx --bun shadcn add @01orbital/rating

Part of the 01orbital library. With a license, put ORBITAL_TOKEN in .env.local and the same command installs it (licensed install, pricing).

It lands at components/forms/rating.tsx, as source you own and edit.

Usage

"use client"

import { useState } from "react"

import { Rating } from "@/components/forms/rating"

// Every word on the page. Change copy here, not in the markup.
const COPY = {
  yours: "Your rating",
  average: "Average rating",
} as const

// Interactive with value and onValueChange; a display without them.
export default function RatingDemo() {
  const [value, setValue] = useState(3)
  return (
    <div className="grid justify-items-center gap-6 text-sm text-muted-foreground">
      <div className="grid justify-items-center gap-1">
        <span>{COPY.yours}</span>
        <Rating
          label={COPY.yours}
          value={value}
          onValueChange={setValue}
          size="lg"
        />
      </div>
      <div className="grid justify-items-center gap-1">
        <span>{COPY.average}</span>
        <Rating label={COPY.average} value={4} />
      </div>
    </div>
  )
}

API reference

Prop

Type

It also accepts the HTML attributes of the element it renders.

Dependencies

npm: @base-ui/react, @phosphor-icons/react, class-variance-authority, cn. The CLI installs them for you.

No other registry pieces.