BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/dominik-portfolio/expandable-tabs

Expandable Tabs

dominik-portfolio/expandable-tabs
FreeComponent

Animated icon tabs with a sliding active pill and an expanding label, built on the shadcn tooltip.

Install it

npx shadcn@latest add https://dominikkoch.dev/r/expandable-tabs.json

Source

components/ui/expandable-tabs.tsxdominikkoch.dev/r/expandable-tabs.json
1"use client";
2
3import {
4 type ReactNode,
5 useCallback,
6 useEffect,
7 useLayoutEffect,
8 useRef,
9 useState,
10} from "react";
11import {
12 Tooltip,
13 TooltipContent,
14 TooltipTrigger,
15} from "@/components/ui/tooltip";
16import { cn } from "@/lib/utils";
17
18interface ExpandableTabsItem {
19 value: string;
20 label: string;
21 icon: ReactNode;
22 href?: string;
23}
24
25interface ExpandableTabsProps {
26 items: ExpandableTabsItem[];
27 value?: string;
28 defaultValue?: string;
29 onValueChange?: (value: string) => void;
30 label?: string;
31 className?: string;
32}
33
34interface ExpandableTabProps {
35 item: ExpandableTabsItem;
36 isActive: boolean;
37 onSelect: (value: string) => void;
38}
39
40function ExpandableTab({ item, isActive, onSelect }: ExpandableTabProps) {
41 const tabClassName =
42 "relative z-10 flex shrink-0 cursor-pointer items-center rounded-[calc(var(--radius-2xl)-6px)] p-2 outline-none transition-colors duration-200 ease-out focus-visible:ring-2 focus-visible:ring-ring";
43
44 const content = (
45 <>
46 {item.icon}
47 <span
48 className={cn(
49 "grid transition-[grid-template-columns,opacity] duration-300 ease-out",
50 isActive ? "grid-cols-[1fr] opacity-100" : "grid-cols-[0fr] opacity-0"
51 )}
52 >
53 <span className="min-w-0 overflow-hidden whitespace-nowrap font-medium text-foreground text-sm">
54 <span className="block w-max pr-1 pl-2">{item.label}</span>
55 </span>
56 </span>
57 </>
58 );
59
60 return (
61 <Tooltip disabled={isActive}>
62 <TooltipTrigger
63 render={
64 item.href ? (
65 <a
66 aria-current={isActive ? "page" : undefined}
67 className={tabClassName}
68 data-value={item.value}
69 href={item.href}
70 >
71 {content}
72 </a>
73 ) : (
74 <button
75 aria-pressed={isActive}
76 className={tabClassName}
77 data-value={item.value}
78 onClick={() => onSelect(item.value)}
79 type="button"
80 >
81 {content}
82 </button>
83 )
84 }
85 />
86 <TooltipContent>{item.label}</TooltipContent>
87 </Tooltip>
88 );
89}
90
91function useActivePill(activeValue: string | undefined) {
92 const menuRef = useRef<HTMLMenuElement>(null);
93 const [pill, setPill] = useState<{
94 left: number;
95 top: number;
96 width: number;
97 height: number;
98 } | null>(null);
99
100 const measure = useCallback(() => {
101// … truncated

What it pulls in

Other registry items

  • tooltip

Files it writes

  • components/ui/expandable-tabs.tsx

Facts

Registry
dominik-portfolio
Type
registry:ui
Access
Free
Files written
1
Licence
the repository states none
In the index
at or before 2026-08-12
Last confirmed
today

Go to the source

dominikkoch.dev mezotv/portfolio on GitHub Raw registry item This item as JSON

More from dominik-portfolio

All 4 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
Braille Loaderbraille-loaderdominik-portfolioComponentsFreeno deps · 2 files
Command Tabscommand-tabsdominik-portfolioComponentsFree1 dep
Permission Selectorpermission-selectordominik-portfolioComponentsFree1 dep

Also from Kynth Studios

Built for the same person as BlockDex

SkillWorks

Claude Code skills and plugins, scored

skillworks.kynth.studio

RuleStack

AGENTS.md gallery and agent-config comparison

rulestack.kynth.studio

ToolDrift

What the AI coding tools changed last night

tooldrift.kynth.studio

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and ToolDrift

part of Toolproof, the measurement layer for AI agent tooling

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and ToolDrift

part of Toolproof, the measurement layer for AI agent tooling

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and ToolDrift

part of Toolproof, the measurement layer for AI agent tooling

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex