component-patterns
Installation
SKILL.md
Component Patterns
1. Compound Components
Use for related components with shared implicit state (Tabs, Accordion, Menu, Select).
import { createContext, useContext, useState, ReactNode } from "react";
interface TabsContextValue {
value: string;
onChange: (value: string) => void;
}
const TabsContext = createContext<TabsContextValue | null>(null);