Highlight Demo
sora-ui/demo-highlightFreeComponent
Shared sliding highlight pill moving between nav items on hover.
Install it
npx shadcn@latest add https://ui.soralabs.io.vn/r/demo-highlight.jsonSource
1"use client";23import {4 Highlight,5 HighlightItem,6} from "@/components/sora-ui/effects/highlight";78const ITEMS = ["Design", "Engineering", "Product", "Marketing", "Growth"];9const MOBILE_ITEMS = ITEMS.slice(0, 3);1011const HIGHLIGHT_PROPS = {12 className: "rounded-full bg-foreground/8",13 containerClassName: "flex items-center",14 mode: "parent" as const,15 trigger: "hover" as const,16};1718function ItemList({ items }: { items: string[] }) {19 return (20 <Highlight {...HIGHLIGHT_PROPS}>21 {items.map((item) => (22 <HighlightItem key={item} value={item}>23 <button24 className="relative z-10 cursor-pointer px-4 py-1.5 text-foreground/60 text-sm transition-colors hover:text-foreground"25 type="button"26 >27 {item}28 </button>29 </HighlightItem>30 ))}31 </Highlight>32 );33}3435export function HighlightDemo() {36 return (37 <div className="flex min-h-40 items-center justify-center">38 <div className="sm:hidden">39 <ItemList items={MOBILE_ITEMS} />40 </div>41 <div className="hidden sm:block">42 <ItemList items={ITEMS} />43 </div>44 </div>45 );46}
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 |
