creating-styled-wrappers

Compose styled wrappers around base components using data-attributes for styling.

11.2k|562|Updated Jun 15, 2024
One-click install
npx skills add https://github.com/tambo-ai/tambo --skill creating-styled-wrappers
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: creating-styled-wrappers
Source: https://github.com/tambo-ai/tambo/tree/main/.claude/skills/creating-styled-wrappers
Command: npx skills add https://github.com/tambo-ai/tambo --skill creating-styled-wrappers

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps developers avoid duplicating styling logic by composing styled wrappers around headless/base components, enabling cleaner refactors and easier design-system adoptions.

Core Features & Use Cases

  • Compose, don't duplicate: Wrap base primitives to apply styling and behavior without reimplementing logic.
  • Design-system alignment: Enforces consistent tokens, variants, and theming across components.
  • Real-world use case: When upgrading an existing component library to use base primitives while preserving visuals.

Quick Start

Create a Styled Wrapper by composing your base component's Root and Content, then apply styling tokens and data-* attributes to drive visuals.

Frequently Asked Questions about creating-styled-wrappers

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I wrap base React components with styling without duplicating internal logic?

To wrap base React components without duplicating internal logic, you compose styled wrappers around the base primitives, applying design-system tokens and leveraging data-* attributes to drive state-based visuals.

What is the best way to refactor a React component library to use base primitives while preserving visuals?

The best way to refactor a React component library to base primitives while preserving visuals is to build a styled wrapper layer that composes the base components, enforcing consistent design-system alignment without reimplementing logic.

How do data- attributes work when composing styled wrappers for design systems?

Data- attributes work in styled wrappers by providing hooks for state-driven styling, allowing you to apply visual changes based on component state while keeping the base component logic intact.

Can I use styled wrappers to enforce design-system tokens and variants during a refactor?

Yes, you can use styled wrappers to enforce design-system tokens and variants during a refactor by composing the wrapper layer around your base components, ensuring consistent theming and visual alignment across your UI.

When should I not use a styled wrapper layer around base components?

You should not use a styled wrapper layer around base components if your refactor requires altering the internal logic of the primitives, as this approach focuses on applying styling without duplicating or reimplementing behavior.