S
Seoffix.com
Sign In Get Pro Membership
Skill CommunityApache-2.0Updated this quarter

Composition Patterns

by Vercel

React composition that does not grow a boolean prop for every state.

OfficialReact
Open upstream 0 installs recorded Source repository Launch page

About this skill

Official Vercel skill. Compound components, slots, and the APIs that still make sense in a year.

Input and output contract

Input

A component that is getting flags.

Output

A composition that drops the flags.

Workflow steps

  1. 1
    Compound components
  2. 2
    Slots
  3. 3
    API shape

Prompt Notebook

You sayThis Button has 11 booleans.
It returnsSplit into Button.Root + variants. Diff attached.
You sayHow should the Field compose?
It returnsField, Label, Control, Error. No layout prop.

More from Vercel

Vercel Agent Skills
vercel-agent-skills
Community

React, composition, and the design rules Vercel actually ships.

SkillOfficialReact
Next.js Best Practices
next-best-practices
Community

Vercel’s skill for the Next.js app you already have.

SkillOfficialNext.js
React Best Practices
vercel-react-best-practices
Community

Vercel’s 40+ rules for React that stays fast.

SkillOfficialReact
OK