Skip to content

InputsLumen Halo

RatingFreev1.0.0

Stars you can set, or a score you show: interactive it's a real radio group (arrows, forms, screen readers) with a hover preview and press-again to clear; read-only it draws fractions and reads "4.3 out of 5".

Built on shadcn/ui

.md
Base UIpnpm dlx shadcn@latest add https://beautiful-ui.dev/r/lumen-rating.json
Radixpnpm dlx shadcn@latest add https://beautiful-ui.dev/r/radix-nova/lumen-rating.json

Free, no account or key. Use the command for your project's primitives: a radix-*, new-york or default style in components.json is Radix, a base-* style is Base UI. With the @beautiful-ui registry added, @beautiful-ui/<name> picks for you.

Install by hand
  1. 1. No extra packages: React and Tailwind CSS v4 are enough.
  2. 2. Copy the files to these paths (Source below, or save them all as a .zip)
    • components/ui/lumen/controls/rating.tsx
  3. 3. Paste styles.css into your global CSS, after @import "tailwindcss";
  4. 4. Install what it builds on first: shadcn's cn helper (lib/utils.ts, from npx shadcn init), the theme foundation (its tokens and base styles)
Styles didn't apply?

The CLI adds the styles to the CSS file named in components.json (tailwind.css). Check that it points at your global stylesheet, that the project uses Tailwind CSS v4, and that the file is imported in your root layout. Installed by hand: paste styles.css into that file.

Set up the Beautiful UI registry

Free pieces install from their URL with no setup (that URL gives the Base UI build; Radix projects use /r/radix-nova/<name>.json, or add the registries below and the CLI picks your build). Pro pieces need the registries below and BEAUTIFUL_UI_TOKEN in .env.local.

components.json
{
  "registries": {
    "@beautiful-ui": "https://beautiful-ui.dev/r/{style}/{name}.json",
    "@beautiful-ui-pro": {
      "url": "https://beautiful-ui.dev/r/pro/{style}/{name}.json",
      "headers": { "Authorization": "Bearer ${BEAUTIFUL_UI_TOKEN}" }
    }
  }
}

MCP server

claude mcp add --transport http beautiful-ui https://beautiful-ui.dev/api/mcp
Catalog for agents: /llms.txt

Usage

Import it and pass your content. The props that matter most are listed next.

Example
"use client";

import * as React from "react";
import { Rating } from "@/components/ui/lumen/controls/rating";

export function ReviewScore({ average, count }: { average: number; count: number }) {
  const [mine, setMine] = React.useState(0);
  return (
    <div className="grid gap-3">
      <div className="flex items-center gap-2">
        <Rating readOnly value={average} size="sm" />
        <span className="text-sm text-muted-foreground">{average.toFixed(1)} from {count} reviews</span>
      </div>
      <Rating aria-label="Your rating" value={mine} onValueChange={setMine} words={["Poor", "Fair", "Good", "Great", "Excellent"]} />
    </div>
  );
}

Props

  • value / defaultValue / onValueChange0

    number / number / (value: number) => void

    The score; 0 is none. Interactive scores are whole numbers.

  • max5

    number

    How many stars.

  • readOnlyfalse

    boolean

    Show a score (fractions fill part of a star) instead of asking for one.

  • clearabletrue

    boolean

    Pressing the chosen star again clears it.

  • words–

    string[]

    A word for each score, shown beside the stars and read with each one.

  • name–

    string

    The radios' name, for forms.

Show all 8 props
  • size"default"

    "sm" | "default" | "lg"

    16, 20 or 26px stars (28px on touch when interactive).

  • icon / labels / locale / aria-label–

    ReactNode / Partial<{ item, score }> / string / string

    Your own glyph, the words for other languages, the number format, and the group's name (default "Rating").

Source

components/ui/lumen/controls/rating.tsx