Vote Control

Upvote and downvote control with a score between two chevrons, aria-pressed states and click again to undo. Built in React for forums and feedback boards.

src/registry/ui/vote-control.tsx/r/vote-control.json

Installation#

bash
npx shadcn@latest add @minidev/vote-control

MiniDev UI is in the shadcn registry directory, so the short form works with no setup. Older CLI versions can use the full URL: npx shadcn@latest add https://ui.minidev.pro/r/vote-control.json

Usage#

tsx
import { VoteControl } from "@/components/ui/vote-control"

export function Example() {
  return <VoteControl />
}

API reference#

VoteControl props
PropTypeDefault
scorenumber0
value"up" | "down" | null-
onChange(value: "up" | "down" | null) => void-
classNamestring-

Dependencies#

npm

lucide-react

Built from

No other MiniDev files
All alerts, toasts and empty states

Learn more