rating-group
shipbase-ui/rating-groupFreeComponent
shipbase/ui publishes no description for this item.
Install it
npx shadcn@latest add https://raw.githubusercontent.com/shipbase/ui/next/apps/www/public/r/react/rating-group.jsonSource
1"use client"23import * as React from "react"45import { RatingGroup as RatingGroupPrimitive } from "@ark-ui/react/rating-group"6import { StarIcon } from "lucide-react"78import { cn } from "@/lib/utils"910const RatingGroup = RatingGroupPrimitive.Root1112const RatingGroupProvider = RatingGroupPrimitive.RootProvider1314const RatingGroupContext = RatingGroupPrimitive.Context1516const RatingGroupLabel = React.forwardRef<17 React.ElementRef<typeof RatingGroupPrimitive.Label>,18 RatingGroupPrimitive.LabelProps19>(({ className, ...props }, ref) => (20 <RatingGroupPrimitive.Label21 ref={ref}22 className={cn(23 "font-medium text-sm leading-none data-[disabled]:cursor-not-allowed data-[disabled]:opacity-70",24 className25 )}26 {...props}27 />28))29RatingGroupLabel.displayName = "RatingGroupLabel"3031const RatingGroupControl = React.forwardRef<32 React.ElementRef<typeof RatingGroupPrimitive.Control>,33 RatingGroupPrimitive.ControlProps34>(({ className, children, ...props }, ref) => (35 <RatingGroupPrimitive.Control36 ref={ref}37 className={cn("flex w-max gap-0.5", className)}38 {...props}39 >40 <RatingGroupPrimitive.HiddenInput />41 {children}42 </RatingGroupPrimitive.Control>43))44RatingGroupControl.displayName = "RatingGroupControl"4546const RatingGroupItem = React.forwardRef<47 React.ElementRef<typeof RatingGroupPrimitive.Item>,48 RatingGroupPrimitive.ItemProps49>(({ className, ...props }, ref) => (50 <RatingGroupPrimitive.Item51 ref={ref}52 className={cn(53 "cursor-pointer transition-all data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50 *:data-[highlighted]:fill-current",54 className55 )}56 {...props}57 >58 <StarIcon />59 </RatingGroupPrimitive.Item>60))61RatingGroupItem.displayName = "RatingGroupItem"6263export {64 RatingGroup,65 RatingGroupContext,66 RatingGroupControl,67 RatingGroupItem,68 RatingGroupLabel,69 RatingGroupProvider,70}
What it pulls in
npm packages
Files it writes
More from shipbase/ui
All 32 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| accordionaccordion | shipbase/ui | Components | Free | 2 deps | |
| avataravatar | shipbase/ui | Components | Free | 1 dep | |
| badgebadge | shipbase/ui | Components | Free | 2 deps | |
| buttonbutton | shipbase/ui | Components | Free | 2 deps | |
| cardcard | shipbase/ui | Components | Free | 1 dep | |
| checkboxcheckbox | shipbase/ui | Components | Free | 2 deps | |
| collapsiblecollapsible | shipbase/ui | Components | Free | 1 dep | |
| comboboxcombobox | shipbase/ui | Components | Free | 2 deps |
