choice-poll-demo
cult-ui/choice-poll-demoUnverifiedComponent
cult/ui publishes no description for this item.
Install it
npx shadcn@latest add https://raw.githubusercontent.com/nolly-studio/cult-ui/HEAD/apps/www/choice-poll-demo.jsonSource
1"use client"23import { useState } from "react"4import {5 Database01Icon,6 DropboxIcon,7 Github01Icon,8 GoogleIcon,9 NotionIcon,10 SlackIcon,11} from "@hugeicons/core-free-icons"12import { HugeiconsIcon } from "@hugeicons/react"1314import { Button } from "@/components/ui/button"15import {16 Card,17 CardContent,18 CardDescription,19 CardHeader,20 CardTitle,21} from "@/components/ui/card"2223import { ChoicePoll } from "../ui/choice-poll"2425/* -----------------------------------------------------------------------------26 * Integration options data27 * -------------------------------------------------------------------------- */2829const integrations = [30 {31 id: "slack",32 label: "Slack",33 description: "Team communication and notifications",34 icon: SlackIcon,35 },36 {37 id: "notion",38 label: "Notion",39 description: "Documentation and knowledge base",40 icon: NotionIcon,41 },42 {43 id: "github",44 label: "GitHub",45 description: "Code repositories and CI/CD",46 icon: Github01Icon,47 },48 {49 id: "google-drive",50 label: "Google Drive",51 description: "File storage and collaboration",52 icon: GoogleIcon,53 },54 {55 id: "dropbox",56 label: "Dropbox",57 description: "Cloud file storage",58 icon: DropboxIcon,59 },60 {61 id: "supabase",62 label: "Supabase",63 description: "Database and authentication",64 icon: Database01Icon,65 },66]6768/* -----------------------------------------------------------------------------69 * Basic Example - Single Selection70 * -------------------------------------------------------------------------- */7172function ChoicePollBasicExample() {73 const [selected, setSelected] = useState<string>("")74 const [hasVoted, setHasVoted] = useState(false)7576 const votes = {77 slack: 234,78 notion: 189,79 github: 156,80 "google-drive": 98,81 }8283 const handleVote = () => {84 setHasVoted(true)85 }8687 return (88 <Card className="w-full max-w-lg">89 <CardHeader>90 <CardTitle>Vote for Next Integration</CardTitle>91 <CardDescription>92 Help us prioritize which integration to build next93 </CardDescription>94 </CardHeader>95 <CardContent>96 <ChoicePoll.Root97 hasVoted={hasVoted}98 onValueChange={(v) =>99 setSelected(Array.isArray(v) ? (v[0] ?? "") : v)100 }101 showResults102 value={selected}103 votes={votes}104 >105 <ChoicePoll.Options>106// … truncated
What it pulls in
Other registry items
Files it writes
More from cult/ui
All 157 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| ai-instructionsai-instructions | cult/ui | Components | Unverified | 2 deps | |
| ai-instructions-demoai-instructions-demo | cult/ui | Components | Unverified | no deps | |
| animated-numberanimated-number | cult/ui | Components | Unverified | 1 dep | |
| animated-number-demoanimated-number-demo | cult/ui | Components | Unverified | no deps | |
| bg-animate-buttonbg-animate-button | cult/ui | Components | Unverified | no deps | |
| bg-animate-button-demobg-animate-button-demo | cult/ui | Components | Unverified | no deps | |
| bg-animated-fractal-dot-gridbg-animated-fractal-dot-grid | cult/ui | Components | Unverified | 1 dep | |
| bg-animated-fractal-dot-grid-demobg-animated-fractal-dot-grid-demo | cult/ui | Components | Unverified | no deps |
