shadcn.io is an independent project built on shadcn/ui
Installation
Overview
Let people fill in a ticket with this prize draw product card for Svelte with Ark UI. A grid of 30 numbered cells, six across, comes first; each is a native checkbox, and a sixth pick is refused in words. At the end a drawn ticket with notched edges fills as you pick, its five rings in ascending order, with the draw date, the prize pool and the odds written out, "Matching all five: 1 in 142,506", worked out from five of thirty. Button "Quick pick" cycles through a typed list of five sets, so nothing is random, and "Clear" empties the ticket. The one Shine Button, "Lock in these numbers", fixes the ticket for this demo. Nothing is bought here. For raffles, community draws and number pickers.
FAQ
Where do the odds come from?
From the count of ways to choose five numbers from thirty, worked out by waysOf, so changing NEEDED or the size of NUMBERS changes the odds line. The prize pool (POOL) is typed.
Is Quick pick random?
No. It steps through the typed sets in QUICK, so the page is the same on every load. In a real draw pick on the server and never in the browser.
What stays local, and how do I wire it for real?
The picks and the lock are page state; nothing is bought, entered or stored. This block is an interface only, and it says so on the ticket. If you build a real draw, check the rules for your region, verify age on the server and add the limits and help links your law requires.
How do I use it with a keyboard?
Tab to the first number, use Space to pick or remove it and Tab on to the next. A full ticket refuses a sixth pick and says why.
Related
- Numbered Edition Product CardOffers and buying modes

- Bid Status Auction Product CardOffers and buying modes

- Stepped Price Flash Sale Product CardOffers and buying modes

- Pledge Preview Crowdfunding Product CardOffers and buying modes

- Stock States Product CardOffers and buying modes

- Bundle Product CardOffers and buying modes
