Rating
A level picked from a row of diamond pips.
Component
Rating belongs to the Choices group in the CyberSpec catalog. It uses @ui-sdk/react/rating.
Installation
Use a React 19 project with shadcn configured. Render the installed components inside the Cyber root, and import your global stylesheet in the app entry point.
bunx --bun shadcn@latest add https://www.cyberspec.dev/r/rating.json
Example
"use client"
import { Rating } from "@/components/ui/rating"
export default function RatingDemo() {
return (
<>
<Rating label="Threat" defaultValue={3} levels={["Low", "Guarded", "Elevated", "High", "Severe"]} />
<Rating label="Heat" defaultValue={1.5} step={0.5} max={4} />
<Rating label="Clearance" value={2} levels={["Street", "Contract", "Vault"]} max={3} hint="Set by Vanta Systems." disabled />
</>
)
}
Install this example
bunx --bun shadcn@latest add https://www.cyberspec.dev/r/rating-demo.json