[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M79031CJZX79ADDVJPSF1R5Q":3,"skill-same:01M79031CJZX79ADDVJPSF1R5Q":62},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":26,"commitSha":27,"skillDirectory":28,"forksCount":29,"repositoryHtmlUrl":30,"repositoryHomepageUrl":31,"ownerHtmlUrl":32,"ownerBlogUrl":33,"ownerDescription":34,"updatedAt":35,"install":36,"resources":49},"01M79031CJZX79ADDVJPSF1R5Q","component-library",null,"Design the component set with consistent structure, states and semantic naming. Use when creating reusable Figma components, variants, or design libraries.","poorvith-mp\u002Fskills-design","poorvith-mp","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F277478855?v=4","01M78Z5K0YH1Z3PX815PGQ96ND","Poorvith M P","01M79023NZMHA7EKM9K6KWHEET",0,"MIT","https:\u002F\u002Fgithub.com\u002Fpoorvith-mp\u002Fskills-design\u002Fblob\u002Fmain\u002Fskills\u002Fcomponent-library\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: component-library\nlast_reviewed: 2026-09-06\ngroup: Design system\ndescription: >-\n  Design the component set with consistent structure, states and semantic naming. Use when\n  creating reusable Figma components, variants, or design libraries.\n---\n\n# component-library\n\n## Core Philosophy\nA component library is not a random collection of buttons and modal components copied from tutorial repositories. A production component library is an ironclad, scalable UI contract between design and frontend engineering. Components must be structured with consistent anatomy, strict state matrices, accessible keyboard interactions, composable primitives, and 1:1 prop parity between Figma design components and React\u002FVue\u002FSvelte code.\n\n---\n\n## 4-Step Component Library Architecture\n\n### Step 1: Component Anatomy & Structural Hierarchy\n1. **Deconstruct the Component Anatomy**:\n   - Every complex component is composed of standard anatomical slots:\n     - *Container \u002F Wrapper*: Handles padding, surface background, border, and elevation.\n     - *Leading Element*: Icon, avatar, or status badge.\n     - *Content Area*: Label, description, children elements.\n     - *Trailing Element*: Chevron, counter badge, action icon, or shortcut tag.\n\n### Step 2: The Complete 7-State Matrix\n1. **Mandatory State Coverage**:\n   - Every interactive component (Button, Input, Select, Checkbox) must explicitly design and test **all 7 states**:\n     - 1. **Default \u002F Rest**: Standard resting appearance.\n     - 2. **Hover**: Cursor over element (subtle lightness change).\n     - 3. **Focused \u002F Focus-Visible**: Keyboard focus ring active (2px high-contrast outline).\n     - 4. **Pressed \u002F Active**: Click\u002Ftap depressed state (scale down or deepened background).\n     - 5. **Loading**: Interactive state locked, subtle spinner active, label preserved in DOM.\n     - 6. **Disabled**: Pointer events disabled (`cursor: not-allowed`), contrast reduced.\n     - 7. **Error \u002F Invalid**: Border and label state flagged with semantic danger tokens and ARIA error messages.\n\n### Step 3: Variants, Sizing & Prop Composability\n1. **Variant Taxonomy**:\n   - *Hierarchy Variants*: `primary`, `secondary`, `outline`, `ghost`, `destructive`.\n   - *Size Ramps*: `sm` (32px height), `md` (40px height - default), `lg` (48px height).\n2. **Prop Parity Between Figma & Code**:\n   - Figma component variant names must match TypeScript component props verbatim:\n     ```typescript\n     interface ButtonProps extends React.ButtonHTMLAttributes\u003CHTMLButtonElement> {\n       variant?: 'primary' | 'secondary' | 'outline' | 'ghost' | 'destructive';\n       size?: 'sm' | 'md' | 'lg';\n       isLoading?: boolean;\n       leadingIcon?: React.ReactNode;\n       trailingIcon?: React.ReactNode;\n     }\n     ```\n\n### Step 4: Headless Foundations & Accessibility Primitives\n1. **Building on Battle-Tested Headless Engines**:\n   - Do not reinvent dropdown focus management, ARIA popover positioning, and keyboard arrow navigation.\n   - Build atop accessible headless primitives: **Radix UI**, **React Aria**, or **Floating UI**.\n   - Ensure components pass complete keyboard audits (`Enter`, `Space`, `Escape`, Arrow navigation).\n\n---\n\n## Deliverable Format: Component Specification (`BUTTON-SPEC.md`)\n\n```markdown\n# Component Specification: Button (`\u003CButton \u002F>`)\n\n## 1. Anatomy & Layout\n- **Layout Model**: Flexbox row, inline-flex, center aligned.\n- **Gap**: 8px between icons and text label.\n- **Border Radius**: 6px (`--radius-md`).\n\n## 2. Variant & State Matrix\n| Variant | Default BG | Hover BG | Active BG | Focus Ring | Text Color |\n|---|---|---|---|---|---|\n| `primary` | `--indigo-600` | `--indigo-700` | `--indigo-800` | 2px `--indigo-500` | `#ffffff` |\n| `secondary` | `--slate-100` | `--slate-200` | `--slate-300` | 2px `--slate-400` | `--slate-900` |\n| `destructive` | `--red-600` | `--red-700` | `--red-800` | 2px `--red-500` | `#ffffff` |\n| `ghost` | `transparent` | `--slate-100` | `--slate-200` | 2px `--slate-400` | `--slate-800` |\n\n## 3. Sizing Specifications\n- **Small (`sm`)**: Height 32px | Padding 0 12px | Typography: 13px\u002F18px\n- **Medium (`md`)**: Height 40px | Padding 0 16px | Typography: 14px\u002F20px\n- **Large (`lg`)**: Height 48px | Padding 0 20px | Typography: 16px\u002F24px\n\n## 4. Accessibility & Keyboard Behavior\n- Implements native `\u003Cbutton>` element.\n- When `isLoading={true}`: Sets `aria-busy=\"true\"` and `disabled`; spinner rendered without shifting button width.\n```\n\n---\n\n## Worked Example: Design System Button Overhaul\n\n- **Problem**: 14 different button styles existed across the web app with inconsistent focus states and layout jumping during loading spinners.\n- **Solution**: Built a unified `\u003CButton \u002F>` component on Radix UI primitives with 5 variants, 3 sizes, and fixed-width loading state overlays.\n- **Outcome**: Eliminated 1,400 lines of duplicated CSS; zero layout shift on form submission.\n\n---\n\n## Verification Checklist\n\n- [ ] Component satisfies all 7 states (Default, Hover, Focus, Active, Loading, Disabled, Error).\n- [ ] TypeScript prop names match Figma component variants 1:1.\n- [ ] Keyboard navigation and ARIA attributes tested via screen reader.\n- [ ] Interactive heights adhere to touch target minimums (>= 40px for default).\n- [ ] Documented in Storybook with visual regression test snapshots.\n\n---\n\n## Anti-Patterns\n\n- **Div Buttons**: Using `\u003Cdiv onClick={...}>` instead of semantic `\u003Cbutton>`, breaking native keyboard focus and screen readers.\n- **Layout-Shifting Loaders**: Replacing button text with a spinner that causes the button to shrink or grow on click.\n- **Missing Focus Rings**: Forgetting the `:focus-visible` state, leaving keyboard navigators blind.\n","# component-library\n\n## Core Philosophy\nA component library is not a random collection of buttons and modal components copied from tutorial repositories. A production component library is an ironclad, scalable UI contract between design and frontend engineering. Components must be structured with consistent anatomy, strict state matrices, accessible keyboard interactions, composable primitives, and 1:1 prop parity between Figma design components and React\u002FVue\u002FSvelte code.\n\n---\n\n## 4-Step Component Library Architecture\n\n### Step 1: Component Anatomy & Structural Hierarchy\n1. **Deconstruct the Component Anatomy**:\n   - Every complex component is composed of standard anatomical slots:\n     - *Container \u002F Wrapper*: Handles padding, surface background, border, and elevation.\n     - *Leading Element*: Icon, avatar, or status badge.\n     - *Content Area*: Label, description, children elements.\n     - *Trailing Element*: Chevron, counter badge, action icon, or shortcut tag.\n\n### Step 2: The Complete 7-State Matrix\n1. **Mandatory State Coverage**:\n   - Every interactive component (Button, Input, Select, Checkbox) must explicitly design and test **all 7 states**:\n     - 1. **Default \u002F Rest**: Standard resting appearance.\n     - 2. **Hover**: Cursor over element (subtle lightness change).\n     - 3. **Focused \u002F Focus-Visible**: Keyboard focus ring active (2px high-contrast outline).\n     - 4. **Pressed \u002F Active**: Click\u002Ftap depressed state (scale down or deepened background).\n     - 5. **Loading**: Interactive state locked, subtle spinner active, label preserved in DOM.\n     - 6. **Disabled**: Pointer events disabled (`cursor: not-allowed`), contrast reduced.\n     - 7. **Error \u002F Invalid**: Border and label state flagged with semantic danger tokens and ARIA error messages.\n\n### Step 3: Variants, Sizing & Prop Composability\n1. **Variant Taxonomy**:\n   - *Hierarchy Variants*: `primary`, `secondary`, `outline`, `ghost`, `destructive`.\n   - *Size Ramps*: `sm` (32px height), `md` (40px height - default), `lg` (48px height).\n2. **Prop Parity Between Figma & Code**:\n   - Figma component variant names must match TypeScript component props verbatim:\n     ```typescript\n     interface ButtonProps extends React.ButtonHTMLAttributes\u003CHTMLButtonElement> {\n       variant?: 'primary' | 'secondary' | 'outline' | 'ghost' | 'destructive';\n       size?: 'sm' | 'md' | 'lg';\n       isLoading?: boolean;\n       leadingIcon?: React.ReactNode;\n       trailingIcon?: React.ReactNode;\n     }\n     ```\n\n### Step 4: Headless Foundations & Accessibility Primitives\n1. **Building on Battle-Tested Headless Engines**:\n   - Do not reinvent dropdown focus management, ARIA popover positioning, and keyboard arrow navigation.\n   - Build atop accessible headless primitives: **Radix UI**, **React Aria**, or **Floating UI**.\n   - Ensure components pass complete keyboard audits (`Enter`, `Space`, `Escape`, Arrow navigation).\n\n---\n\n## Deliverable Format: Component Specification (`BUTTON-SPEC.md`)\n\n```markdown\n# Component Specification: Button (`\u003CButton \u002F>`)\n\n## 1. Anatomy & Layout\n- **Layout Model**: Flexbox row, inline-flex, center aligned.\n- **Gap**: 8px between icons and text label.\n- **Border Radius**: 6px (`--radius-md`).\n\n## 2. Variant & State Matrix\n| Variant | Default BG | Hover BG | Active BG | Focus Ring | Text Color |\n|---|---|---|---|---|---|\n| `primary` | `--indigo-600` | `--indigo-700` | `--indigo-800` | 2px `--indigo-500` | `#ffffff` |\n| `secondary` | `--slate-100` | `--slate-200` | `--slate-300` | 2px `--slate-400` | `--slate-900` |\n| `destructive` | `--red-600` | `--red-700` | `--red-800` | 2px `--red-500` | `#ffffff` |\n| `ghost` | `transparent` | `--slate-100` | `--slate-200` | 2px `--slate-400` | `--slate-800` |\n\n## 3. Sizing Specifications\n- **Small (`sm`)**: Height 32px | Padding 0 12px | Typography: 13px\u002F18px\n- **Medium (`md`)**: Height 40px | Padding 0 16px | Typography: 14px\u002F20px\n- **Large (`lg`)**: Height 48px | Padding 0 20px | Typography: 16px\u002F24px\n\n## 4. Accessibility & Keyboard Behavior\n- Implements native `\u003Cbutton>` element.\n- When `isLoading={true}`: Sets `aria-busy=\"true\"` and `disabled`; spinner rendered without shifting button width.\n```\n\n---\n\n## Worked Example: Design System Button Overhaul\n\n- **Problem**: 14 different button styles existed across the web app with inconsistent focus states and layout jumping during loading spinners.\n- **Solution**: Built a unified `\u003CButton \u002F>` component on Radix UI primitives with 5 variants, 3 sizes, and fixed-width loading state overlays.\n- **Outcome**: Eliminated 1,400 lines of duplicated CSS; zero layout shift on form submission.\n\n---\n\n## Verification Checklist\n\n- [ ] Component satisfies all 7 states (Default, Hover, Focus, Active, Loading, Disabled, Error).\n- [ ] TypeScript prop names match Figma component variants 1:1.\n- [ ] Keyboard navigation and ARIA attributes tested via screen reader.\n- [ ] Interactive heights adhere to touch target minimums (>= 40px for default).\n- [ ] Documented in Storybook with visual regression test snapshots.\n\n---\n\n## Anti-Patterns\n\n- **Div Buttons**: Using `\u003Cdiv onClick={...}>` instead of semantic `\u003Cbutton>`, breaking native keyboard focus and screen readers.\n- **Layout-Shifting Loaders**: Replacing button text with a spinner that causes the button to shrink or grow on click.\n- **Missing Focus Rings**: Forgetting the `:focus-visible` state, leaving keyboard navigators blind.\n",{"name":5,"group":24,"description":7,"last_reviewed":25},"Design system",1788652800000,"main","502b1a762b2c40a4ad7faa6297e2ebf7e4682efc","skills\u002Fcomponent-library",1,"https:\u002F\u002Fgithub.com\u002Fpoorvith-mp\u002Fskills-design","https:\u002F\u002Fgithub.com\u002Fpoorvith-mp\u002Fskillary","https:\u002F\u002Fgithub.com\u002Fpoorvith-mp","poorvithmp.com","Shipping tools for problems people notice too late.","2026-10-02 21:32:17",{"source":8,"skillName":5,"commands":37,"prompt":47,"zipAvailable":48},[38,41,44],{"tool":39,"command":40},"npx","npx skills add poorvith-mp\u002Fskills-design --skill component-library",{"tool":42,"command":43},"bunx","bunx skills add poorvith-mp\u002Fskills-design --skill component-library",{"tool":45,"command":46},"pnpm","pnpm dlx skills add poorvith-mp\u002Fskills-design --skill component-library","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fpoorvith-mp\u002Fskills-design\u002Fblob\u002Fmain\u002Fskills\u002Fcomponent-library\u002FSKILL.md",true,[50,56],{"path":51,"resourceType":52,"resourceTypeDesc":53,"sizeBytes":54,"sourceHtmlUrl":55},"component-library.skill","OTHER","其他",3390,"https:\u002F\u002Fgithub.com\u002Fpoorvith-mp\u002Fskills-design\u002Fblob\u002Fmain\u002Fskills\u002Fcomponent-library\u002Fcomponent-library.skill",{"path":57,"resourceType":58,"resourceTypeDesc":59,"sizeBytes":60,"sourceHtmlUrl":61},"evals\u002Frouting.yaml","REFERENCE","参考文档",1010,"https:\u002F\u002Fgithub.com\u002Fpoorvith-mp\u002Fskills-design\u002Fblob\u002Fmain\u002Fskills\u002Fcomponent-library\u002Fevals\u002Frouting.yaml",[63,70,76,82,88,95],{"skillNo":64,"name":65,"nameZh":6,"description":66,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":67,"categories":68,"keywords":69,"publishedAt":19},"01M7906MDY214MTS6J24WC9HCM","youtube-thumbnail-maker","Moved to modernized catalog in skillary. Removed in v4.1.","https:\u002F\u002Fgithub.com\u002Fpoorvith-mp\u002Fskills-design\u002Fblob\u002Fmain\u002Fskills\u002Fyoutube-thumbnail-maker\u002FSKILL.md",[],[],{"skillNo":71,"name":72,"nameZh":6,"description":66,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":73,"categories":74,"keywords":75,"publishedAt":19},"01M7906JSPSGETSSTXYTEDN5GT","youtube-popup-graphic","https:\u002F\u002Fgithub.com\u002Fpoorvith-mp\u002Fskills-design\u002Fblob\u002Fmain\u002Fskills\u002Fyoutube-popup-graphic\u002FSKILL.md",[],[],{"skillNo":77,"name":78,"nameZh":6,"description":66,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":79,"categories":80,"keywords":81,"publishedAt":19},"01M7906GYHJ8Z846MTA9FPEVE9","whimsy-injector","https:\u002F\u002Fgithub.com\u002Fpoorvith-mp\u002Fskills-design\u002Fblob\u002Fmain\u002Fskills\u002Fwhimsy-injector\u002FSKILL.md",[],[],{"skillNo":83,"name":84,"nameZh":6,"description":66,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":85,"categories":86,"keywords":87,"publishedAt":19},"01M7906FK39C4JEE36EXD8R8ZC","visual-storyteller","https:\u002F\u002Fgithub.com\u002Fpoorvith-mp\u002Fskills-design\u002Fblob\u002Fmain\u002Fskills\u002Fvisual-storyteller\u002FSKILL.md",[],[],{"skillNo":89,"name":90,"nameZh":6,"description":91,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":92,"categories":93,"keywords":94,"publishedAt":19},"01M7906D196H7PN42711NX46RE","ux-researcher","Moved to ux-research in skills-design. Removed in v4.1.","https:\u002F\u002Fgithub.com\u002Fpoorvith-mp\u002Fskills-design\u002Fblob\u002Fmain\u002Fskills\u002Fux-researcher\u002FSKILL.md",[],[],{"skillNo":96,"name":97,"nameZh":6,"description":98,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":99,"categories":100,"keywords":101,"publishedAt":19},"01M7906A5DJYRN1P5MQJPNN53K","ux-research","Plan and run usability studies and behavioural analysis, then turn findings into research-backed personas. Use when running usability tests, journey mapping, or observing user behavior.","https:\u002F\u002Fgithub.com\u002Fpoorvith-mp\u002Fskills-design\u002Fblob\u002Fmain\u002Fskills\u002Fux-research\u002FSKILL.md",[],[]]