How do you handle empty, loading and error variants inside your component library?
Most of our components are documented in their happy state. But every table, list and card also needs an empty state, a loading state and an error state, and teams keep reinventing those.
Do you build these as variants of each component, as separate shared patterns, or as a slot that each team fills in? I'd love to know what structure has scaled for you.
Comments · 3
We made them separate "state" props on the component with sensible defaults, so developers don't hand-roll skeletons. One loading prop is easier than five custom versions.
Document them in the same place as the happy state, with a short note on when to use each. People copy what they find first, so make the correct version the easiest one to find.
Error states especially need guidance on copy: what happened, what to do next. Components can enforce the layout, but writing guidance matters more than people expect.