Skill / Refined UI registry
Context vs props
Reach for a compound-component context only when props cannot reach the part, and store intent in it, not styling.
Goal
Keep compound-component context to the cases props cannot cover, and put semantic intent in the value rather than precomputed classes.
Registry-first guidance for installable Refined UI components, skins, hooks, and blocks.
Checks
1Add a context only when both hold: the Root owns something parts need (state, or a mode that also styles the Root), and consumers place those parts in JSX you do not control, so a prop cannot reach them.
2Store the smallest semantic value — modes, flags, callbacks — and let each part derive its own classes; do not freeze precomputed className strings in the value.
3Let a per-part prop override the context default (`maxHeight ?? context.maxHeight`), so context is the cascade and props are the escape hatch.
Avoid
1Creating a context for parts you fully control or that share nothing with the Root — pass props instead.
2Freezing precomputed Tailwind strings in the context value, which couples every part to the Root and blocks skins from varying by attribute.