BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/edgecom/motion-tabs

Motion Tabs

edgecom/motion-tabs
FreeComponent

The Edgecom Motion Tabs component.

Install it

npx shadcn@latest add https://design.edgecom.ai/r/motion-tabs.json

Source

src/components/ui/motion-tabs.tsxdesign.edgecom.ai/r/motion-tabs.json · first 6 KB
1'use client'
2
3import * as React from 'react'
4
5import { motion, type Transition, type HTMLMotionProps } from 'motion/react'
6
7import { cn } from '@/lib/utils'
8import { MotionHighlight, MotionHighlightItem } from '@/components/ui/motion-highlight'
9
10type TabsContextType<T extends string> = {
11 activeValue: T
12 handleValueChange: (value: T) => void
13 registerTrigger: (value: T, node: HTMLElement | null) => void
14}
15
16// eslint-disable-next-line @typescript-eslint/no-explicit-any
17const TabsContext = React.createContext<TabsContextType<any> | undefined>(undefined)
18
19function useTabs<T extends string = string>(): TabsContextType<T> {
20 const context = React.useContext(TabsContext)
21
22 if (!context) {
23 throw new Error('useTabs must be used within a TabsProvider')
24 }
25
26 return context
27}
28
29type BaseTabsProps = React.ComponentProps<'div'> & {
30 children: React.ReactNode
31}
32
33type UnControlledTabsProps<T extends string = string> = BaseTabsProps & {
34 defaultValue?: T
35 value?: never
36 onValueChange?: never
37}
38
39type ControlledTabsProps<T extends string = string> = BaseTabsProps & {
40 value: T
41 onValueChange?: (value: T) => void
42 defaultValue?: never
43}
44
45type TabsProps<T extends string = string> = UnControlledTabsProps<T> | ControlledTabsProps<T>
46
47function Tabs<T extends string = string>({
48 defaultValue,
49 value,
50 onValueChange,
51 children,
52 className,
53 ...props
54}: TabsProps<T>) {
55 const [activeValue, setActiveValue] = React.useState<T | undefined>(defaultValue ?? undefined)
56 const triggersRef = React.useRef(new Map<string, HTMLElement>())
57 const initialSet = React.useRef(false)
58 const isControlled = value !== undefined
59
60 React.useEffect(() => {
61 if (!isControlled && activeValue === undefined && triggersRef.current.size > 0 && !initialSet.current) {
62 const firstTab = Array.from(triggersRef.current.keys())[0]
63
64 setActiveValue(firstTab as T)
65 initialSet.current = true
66 }
67 }, [activeValue, isControlled])
68
69 const registerTrigger = (value: string, node: HTMLElement | null) => {
70 if (node) {
71 triggersRef.current.set(value, node)
72
73 if (!isControlled && activeValue === undefined && !initialSet.current) {
74 setActiveValue(value as T)
75 initialSet.current = true
76 }
77 } else {
78 triggersRef.current.delete(value)
79 }
80 }
81
82 const handleValueChange = (val: T) => {
83 if (!isControlled) setActiveValue(val)
84 else onValueChange?.(val)
85 }
86
87 return (
88 <TabsContext.Provider
89 value={{
90// … truncated

What it pulls in

Other registry items

  • edgecom-ai/design-system/theme

Files it writes

  • src/components/ui/motion-tabs.tsx

Facts

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

Go to the source

Docs on edgecom design.edgecom.ai edgecom-ai/design-system on GitHub Raw registry item This item as JSON

More from edgecom

All 66 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
AccordionaccordionedgecomComponentsFree2 deps
AlertalertedgecomComponentsFree1 dep
Alert Dialogalert-dialogedgecomComponentsFree1 dep
AvataravataredgecomComponentsFree1 dep
BadgebadgeedgecomComponentsFree2 deps
BannerbanneredgecomComponentsFree1 dep
BreadcrumbbreadcrumbedgecomComponentsFree2 deps
ButtonbuttonedgecomComponentsFree2 deps

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

KitGrade

SaaS starter kits, scored on what can be checked

kitgrade.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 KitGrade

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 KitGrade

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 KitGrade

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