Highlight Click Demo
sora-ui/demo-highlight-clickFreeComponent
Per-item fade background activated on click — menu list style.
Install it
npx shadcn@latest add https://ui.soralabs.io.vn/r/demo-highlight-click.jsonSource
1"use client";23import {4 Highlight,5 HighlightItem,6} from "@/components/sora-ui/effects/highlight";78const MENU_ITEMS = [9 { value: "inbox", label: "Inbox", count: 12 },10 { value: "drafts", label: "Drafts", count: 3 },11 { value: "sent", label: "Sent" },12 { value: "starred", label: "Starred" },13 { value: "archive", label: "Archive" },14];1516export function HighlightClickDemo() {17 return (18 <div className="flex w-full items-center justify-center px-4 py-6">19 <div className="flex w-full max-w-52 flex-col overflow-hidden rounded-lg border border-border/50 bg-background shadow-sm">20 <Highlight21 className="rounded-md bg-foreground/8"22 defaultValue="inbox"23 mode="children"24 trigger="click"25 >26 {MENU_ITEMS.map(({ value, label, count }) => (27 <HighlightItem key={value} value={value}>28 <button29 className="flex w-full cursor-pointer items-center justify-between px-3 py-2 text-left text-sm"30 type="button"31 >32 <span>{label}</span>33 {count === undefined ? null : (34 <span className="text-foreground/40 text-xs tabular-nums">35 {count}36 </span>37 )}38 </button>39 </HighlightItem>40 ))}41 </Highlight>42 </div>43 </div>44 );45}4647export default HighlightClickDemo;
What it pulls in
Other registry items
Files it writes
More from Sora UI
All 97 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Accordionaccordion | Sora UI | Components | Free | 2 deps | |
| Border Trailborder-trail | Sora UI | Components | Free | 1 dep | |
| Bottom Sheetbottom-sheet | Sora UI | Components | Free | 2 deps | |
| Cursor Bubblecursor-bubble | Sora UI | Components | Free | 2 deps | |
| Cursor Trail Revealcursor-trail-reveal | Sora UI | Components | Free | 1 dep | |
| Custom Cursorcustom-cursor | Sora UI | Components | Free | 2 deps | |
| Accordion Demodemo-accordion | Sora UI | Components | Free | no deps | |
| Border Trail Demodemo-border-trail | Sora UI | Components | Free | no deps |
