Skip to content
DocsSupportPricing
Roadmap (has updates coming soon)XFigma3.7K
Sign inGet All-Access
Overview
  • Introduction
  • Get Started
  • License Setup
  • Styling
  • Registry
  • MCP Server
  • Embed
  • Agent Skills
  • llms.txt
  • RTL
  • Changelogv2.8.1
  • YouTube
MCP Server
  • Claude
  • CodexCodexCodex
  • Cursor
  • Grok
  • Conductor
  • v0
  • Lovable
  • Replit
  • Bolt
  • OpenCode
  • VS Code
  • GitHub Copilot
  • Kilo Code
  • Zed
  • Antigravity
  • Gemini CLI
Components
  • Alert
  • Autocomplete
  • Badge
  • CascaderCascader keeps a saved selection's full path, popup open or closed
  • Code Block
  • Color Picker
  • Data GridData Grid works in apps that run React Compiler, with resizing, edits and callbacks kept live
  • Date SelectorDate Selector keeps its year list and Today button current in apps that run React Compiler
  • Emoji Picker
  • Event CalendarEvent Calendar keeps today and the agenda current in apps that run React Compiler
  • File TypeFile Type knows 171 formats, .env and Dockerfile included
  • File Upload
  • Filters
  • Frame
  • GanttGantt keeps its Today button and tooltip current in apps that run React Compiler
  • Icon Stack
  • Icon Tile
  • Kanban
  • Number Field
  • Phone Input
  • Rating
  • Scrollspy
  • Signature Pad
  • Sortable
  • Stepper
  • Time Picker
  • Timeline
  • Tree

Application

  • App Shell
  • Auth
  • Card
  • Dashboard
  • Dialog
  • Empty State
  • Event Calendar
  • Flow
  • Form
  • Gantt
  • Kanban Board
  • List
  • Navbar
  • Onboarding
  • Profile
  • Rich Text Editor
  • Schedule
  • Settings
  • Sheet
  • Stats2 meter cards moved here from Charts, 17 in all
  • Timeline
  • Whiteboard
  • Wizard

Data Grid

  • Base
  • AdvancedAdded 2 new Data Grid Advanced blocks, 5 in all
  • Columns
  • Drag & Drop
  • Editing
  • Expansion
  • Filtering
  • Grouping
  • Virtualization

Charts

  • Area ChartAdded a new Inbound Leads area chart block
  • Bar Chart
  • Composed Chart
  • Line Chart
  • Pie Chart
  • Radial Chart
  • Sankey ChartNew Sankey Chart category with 3 flow chart blocks
  • Slope ChartNew Slope Chart category with 2 rank-shift chart blocks
  • Sparkline
  • Status Tracker

AI & Agents

  • AI Chat
  • Agent Activity
  • AI UsageNew AI Usage category with 2 spend blocks

Solutions

  • Dev Ops
  • AI Ops
  • CRM
  • Agents
  • Analytics
  • Billing
  • Bookings
  • Files
  • Inventory
  • Users
  • Digital TwinNew Digital Twin category with 2 interactive 3D blocks

Templates

  • All templates

eCommerce

  • Category Card
  • Checkout
  • Comparison
  • Coupon
  • Filter Sidebar
  • Product Card
  • Product Detail
  • Product Grid
  • Receipt
  • Review
  • Shopping Cart
  • Wishlist
  • Shop Hero

Marketing

  • Blog
  • Compare
  • Contact
  • CTA
  • FAQ
  • Hero
  • How It Works
  • Pricing

Resources

  • Components
  • Blocks
  • Icons
  • MCP for Agents
  • Docs
  • Support
  • Pricing
  • Tailwind Plus Alternative
  • Roadmap(has updates coming soon)
  • AffiliateSoon

Legal

  • Privacy Policy
  • Terms & Conditions
  • License
  • Refunds
  • Cookies

© 2026 ReUI. All rights reserved.

3.7K

Shadcn Rating

PreviousNext

Custom Shadcn Rating for React and Tailwind CSS. A customizable star rating component that supports read-only display and interactive input modes.

Base UIRadix UI
Radix UI

Installation

pnpm dlx shadcn@latest add @reui/rating

Usage

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

Shadcn Rating Free Components

Browse 9 production-ready Shadcn Rating components for dashboards, forms, and product UI. These examples follow the Radix UI implementation with accessible primitives from the Radix stack and stay fully compatible with Shadcn Create so radius, color, and typography match your configured theme.

Browse all 9 Shadcn Rating components for copy-ready layouts, dashboards, and forms built with Tailwind CSS in the ReUI library.

Phone InputScrollspy

On This Page

InstallationUsageFor AI AgentsExamplesDecimalShow ValueEditableSizeAPI ReferenceRating
<
Rating
rating
=
{
4.5
}
showValue
editable
/>

For AI Agents

Hand your agent this brief or the ReUI MCP, not a screenshot. Free to install.

When to use

  • Read only star scores at 3 sizes, with partial stars for averages such as 3.5 or 4.6
  • Star inputs that collect a whole star score in feedback and written review forms
  • Review summaries with a count bar per star level, and 5 step emoji scales for quick feedback

When not to use

  • A full product page section of buyer quotes, avatars and a ratings overview: use the Review blocks
  • A required score that keyboard and screen reader users must be able to set: use the Radio Group component
  • A score picked in half or finer steps rather than whole stars: use the Slider component

Agent notes

  • An editable Rating takes pointer clicks only: each star is a div with an onClick and no role, tab stop or key handler
  • Clicks send whole numbers from 1 to maxRating to onRatingChange; a decimal rating draws a partial star but cannot be picked
  • starClassName styles the showValue number, not the stars; recolor stars from className through the rating-star-filled slot
Markdownhttps://web.dev.reui.io/docs/components/radix/rating.md
MCPget_component("rating")
Installnpx shadcn@latest add @reui/rating
Full index for agents:llms.txtReUI MCP setup

Examples

Decimal

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

export function Pattern() {
  return <Rating rating={3.5} />
}

Show Value

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

export function Pattern() {
  return <Rating rating={4.5} showValue={true} />
}

Editable

"use client"

import { useState } from "react"
import { Rating } from "@/components/reui/rating"
import { toast } from "sonner"

export function Pattern() {
  const [productRating, setProductRating] = useState(0)

  const handleRatingChange = (rating: number) => {
    setProductRating(rating)

    toast.success("Rated {rating} out of 5", {
      description: `Rated ${rating} out of 5`,
    })
  }

  return (
    <div className="space-y-8">
      <Rating
        rating={productRating}
        editable={true}
        onRatingChange={handleRatingChange}
        showValue={true}
      />
    </div>
  )
}

Size

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

export function Pattern() {
  return (
    <div className="flex flex-col items-center gap-4">
      <Rating rating={4} size="sm" />
      <Rating rating={4} />
      <Rating rating={4} size="lg" />
    </div>
  )
}

API Reference

Rating

The main component for displaying and editing star ratings.

PropTypeDefaultDescription
ratingnumber-Required. The current rating value. Supports decimal values for partial stars.
maxRatingnumber5Total number of stars to display.
size"sm" | "default" | "lg""md"The size of the stars and spacing.
showValuebooleanfalseWhether to show the numeric rating value next to the stars.
editablebooleanfalseWhether the rating can be changed by clicking on stars.
onRatingChange(rating: number) => void-Callback fired when a star is clicked (if editable is true).
starClassNamestring-Additional CSS classes for the numeric value container.
classNamestring-Additional CSS classes for the root container.
import { Rating } from "@/components/reui/rating"

export function Pattern() {
  return <Rating rating={4} />
}