Variants
A dialog has too many boolean modes
Replace combinations like compact, confirm, destructive, and showFooter with named compositions where behavior is visible at the call site.
01 / The skill · React · Component architecture
This Skill helps redesign React components whose behavior is controlled by a growing list of boolean props. Its focus is composition, shared context, and explicit variants.
Published by Vercel Labs · Type: React architecture Skill
Independent guide. Vercel Labs has not endorsed Floatboat.
Upstream installation
npx skills add vercel-labs/agent-skills --skill vercel-composition-patternsThis is the upstream Skill installation command, not a Floatboat installer.
The source favors compound components and provider-owned state over prop combinations that multiply. It is most useful while designing a component library or untangling a component whose API is hard to reason about.
Ask the agent
“Refactor this Modal with six boolean props into an API that supports confirm and edit flows without surprising combinations.”
A useful result
A useful proposal shows the new public API, one migrated call site, state ownership, and what happens to existing uses.
Use this Skill when the component API has become difficult to use or extend.
Variants
Replace combinations like compact, confirm, destructive, and showFooter with named compositions where behavior is visible at the call site.
State
Place the state and actions in a provider rather than threading them through every intermediate component.
Library
Expose compound parts or explicit variants so consumers can assemble layouts without reimplementing internals.
Start from real call sites, identify stable parts, then move shared behavior behind an explicit interface.
List the combinations that exist today and those that should not be possible.
Use compound components or explicit variants; keep the provider responsible for shared state.
Convert common and edge call sites before removing the old API.
02 / Practical guide
A better API exposes meaningful parts. The pattern choice should follow how the component is used, not a blanket ban on booleans.
Each new switch can interact with existing switches, creating undocumented combinations. The Skill recommends making meaningful variants explicit or letting callers assemble compound parts.
Most composition guidance is general React architecture. The source marks React 19-specific API advice separately; skip that section for React 18 or earlier.
Read another Skill guide and check its original source before using it.
03 / Put it to work · Work through the refactor
Bring the component, its call sites, and design constraints into one Floatboat task before changing the public API.