BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/shadcn-lit-registry/tabs

Tabs

shadcn-lit-registry/tabs
FreeComponent

A set of layered sections of content—known as tab panels—that are displayed one at a time. Built with Lit and styled using Tailwind CSS. Features keyboard navigation and accessible ARIA attributes.

Install it

npx shadcn@latest add https://lit-registry.lloydrichards.dev/r/tabs.json

Source

registry/ui/tabs/tabs.tslit-registry.lloydrichards.dev/r/tabs.json · first 6 KB
1import { html, LitElement, nothing, type PropertyValues } from "lit";
2import {
3 customElement,
4 property,
5 queryAssignedElements,
6} from "lit/decorators.js";
7import { TW } from "@/registry/lib/tailwindMixin";
8import { cn } from "@/registry/lib/utils";
9
10export interface TabsChangeEvent extends CustomEvent {
11 detail: { value: string };
12}
13
14export interface TabsProperties {
15 value?: string;
16 defaultValue?: string;
17}
18
19@customElement("ui-tabs")
20export class Tabs extends TW(LitElement) implements TabsProperties {
21 @property({ type: String }) value = "";
22 @property({ type: String, attribute: "default-value" }) defaultValue = "";
23
24 override connectedCallback() {
25 super.connectedCallback();
26 this.setAttribute("data-orientation", "horizontal");
27
28 if (!this.value && this.defaultValue) {
29 this.value = this.defaultValue;
30 }
31
32 this.addEventListener("tabs-trigger-click", this.handleTriggerClick);
33 }
34
35 override disconnectedCallback() {
36 super.disconnectedCallback();
37 this.removeEventListener("tabs-trigger-click", this.handleTriggerClick);
38 }
39
40 private handleTriggerClick = (e: CustomEvent) => {
41 const newValue = e.detail.value;
42 if (newValue !== this.value) {
43 this.value = newValue;
44 this.dispatchEvent(
45 new CustomEvent("change", {
46 detail: { value: newValue },
47 bubbles: true,
48 composed: true,
49 }),
50 );
51 }
52 };
53
54 override updated(changedProperties: PropertyValues) {
55 super.updated(changedProperties);
56
57 if (changedProperties.has("value")) {
58 this.updateTriggers();
59 this.updateContents();
60 }
61 }
62
63 private updateTriggers() {
64 const triggers = Array.from(
65 this.querySelectorAll("ui-tabs-trigger"),
66 ) as TabsTrigger[];
67 triggers.forEach((trigger) => {
68 trigger.selected = trigger.value === this.value;
69 });
70 }
71
72 private updateContents() {
73 const contents = Array.from(
74 this.querySelectorAll("ui-tabs-content"),
75 ) as TabsContent[];
76 contents.forEach((content) => {
77 content.active = content.value === this.value;
78 });
79 }
80
81 override render() {
82 return html`<slot></slot>`;
83 }
84}
85
86@customElement("ui-tabs-list")
87export class TabsList extends TW(LitElement) {
88 @queryAssignedElements({ selector: "ui-tabs-trigger" })
89 private triggers!: Array<TabsTrigger>;
90
91 override connectedCallback() {
92 super.connectedCallback();
93 this.setAttribute("role", "tablist");
94// … truncated

Files it writes

  • registry/ui/tabs/tabs.ts
  • registry/ui/tabs/tabs.stories.ts

Facts

Registry
shadcn-lit-registry
Type
registry:component
Access
Free
Files written
2
Licence
the repository states none
In the index
at or before 2026-08-09
Last confirmed
today

Go to the source

lit-registry.lloydrichards.dev lloydrichards/proj_shadcn-lit-registry on GitHub Raw registry item This item as JSON

More from shadcn-lit-registry

All 26 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
Accordionaccordionshadcn-lit-registryComponentsFree1 dep · 2 files
Avataravatarshadcn-lit-registryComponentsFreeno deps · 2 files
Badgebadgeshadcn-lit-registryComponentsFreeno deps · 2 files
Buttonbuttonshadcn-lit-registryComponentsFree1 dep · 2 files
Cardcardshadcn-lit-registryComponentsFreeno deps · 2 files
Checkboxcheckboxshadcn-lit-registryComponentsFree1 dep · 2 files
Collapsiblecollapsibleshadcn-lit-registryComponentsFree1 dep · 2 files
Commandcommandshadcn-lit-registryComponentsFree1 dep · 2 files

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