Faragiri
English

Choose a language 2

Learn Components Interface design · Buttons, Inputs, Navigation and 2 more

A vet booking kit: why states are not variants, the slot that turns a hundred components into one, and the audit of which states were ever drawn.

5Branches
5Nodes below
3Depth

Recommended Before This

0 / 2

A button with three emphases, two sizes and four states is not nine things, it is twenty four. Three emphases by two sizes by four states is 24 drawings, and a kit that treats every one of those as a separate item is a kit nobody can hold in their head by the second month.

Sara is building the component set for a veterinary practice booking system in Lyon. Five components carry most of it: the button, the field, the appointment row, the tab bar and the confirm dialogue. The argument below is how to get twenty four drawings down to one component with three properties.

States are properties, not variants

The multiplication only explodes if every axis is treated the same way. States are properties, not variants: default, hover, focus and disabled are things a component is temporarily in, driven by the browser or the code, and they are drawn once each rather than combined with everything else. That takes the button from 24 items to 6, which is three emphases by two sizes, each of which knows how to be hovered.

Properties instead of permutations

Separating browser states from component properties cuts the button set by three-quarters

Keep emphasis as a variant and icon presence as a boolean, while leaving default, hover, focus, and disabled as runtime states.

Items shown in the component panel for one button

States baked into variantsStates handled as behaviour

  1. Button component panel24 items6Three emphases by two sizes stay explicit; four states apply dynamically

Variant for what the button is, boolean for what it has: reversing that rule multiplies items instead of adding properties.

Modular Type Scale & CSS Flex/Grid Motion Lab

Test harmonic typography ratios and live Flexbox/Grid layouts with 1-click CSS export.

Then the naming rule that decides everything else. Use a variant for what it is and a boolean for what it has: primary, secondary and quiet are what a button is, so they are one variant property with three values. An icon is something a button has, so it is a boolean. Get that backwards and you end up with a variant called primary-with-icon, then primary-with-icon-small, and the list grows by multiplication instead of by addition.

Sara's button is therefore one component with emphasis, size and hasIcon, and the four states are behaviour. The states themselves, and what each one owes a person who cannot see it, are hierarchy, states and what a button promises.

Five uniform precision-machined dark slate and brushed-steel square component tiles aligned in a clean horizontal row over muted sage linen.
Model hover, focus, disabled, loading, and error as orthogonal state properties on one component instead of splitting them into messy variants.

A slot is the difference between one component and a hundred

A component that takes a slot is one component; one that hardcodes is a hundred. The appointment row shows a pet's name, an owner, a time and a status. Built with those four things baked in, it is an appointment row and nothing else, and the next screen needing a row with a photograph gets a second component that is nearly the same.

Slots beat hardcoding

How leading and trailing slots turn four separate row components into one

Hardcoding pet name, owner, time, and status locks the row to appointments; slots let four screens share one layout.

  • Flexible end slotsLeading and trailing areas accept different content per view
    • Appointments
    • Invoices
    • Waiting list
    • Search results
  • Self-evident property APIColleagues use it without inspecting inside the component
    • Named by job, not screen
    • Clear property labels
One slotted Row component
  • Shared layout rulesPadding and alignment stay consistent in one place
    • Single spacing edit
    • No near-duplicate rows

The real test of a component API is whether a teammate can configure it without opening its layers.

Give it a slot at each end and it is the row for appointments, invoices, the waiting list and search results: four screens, one component, one place to fix the padding. This is the decision that changes the most in a kit, and it is taken in the first week, usually without discussion.

The test for whether the API came out right is not a review, it is use: the API test is whether somebody can use it without opening it. If a colleague has to open your component to find out what the third property does, the property is named wrong or the component is doing two jobs. That test applies hardest to the awkward ones, which are fields, selects and getting data in and dense data that stays scannable.

Count the states that are drawn

Every kit claims four states and most have them on the button only. Sara counted, per component, how many of its six variants exist in each state. The button has all six in all four. The field has six in three states and two in focus. The appointment row has four in default and none anywhere else, and the confirm dialogue has one drawing and no states at all.

Five components, four states

How many of each component's six variants exist in each state

The disabled column is the one that falls apart, and it is the state a person meets when something has gone wrong.

Variants drawn per state, out of six. Counted in the Lyon kit in 2026; the practice is invented and a grid this uneven is the ordinary case.

defaulthoverfocusdisabled
Button6666
Field6626
Appointment row4000
Tab bar3310
Confirm dialogue1000

A zero here means nobody drew it, not that the state cannot happen: every one of these components enters all four states in the browser whether or not anybody decided what they look like.

So count the states that are drawn, not the ones that exist. The disabled column is where it always falls apart, because disabled is the state nobody demos and the one a person meets when something has gone wrong. The dialogue is worse, and it is the ordinary case for anything that interrupts: when to interrupt, and when not to.

Compartmentalized oiled walnut grid tray holding uniform textured dark basalt square tiles in a tidy matrix over emerald-sage cloth.
Lay out every combination of size, interaction state, and content length in a visual matrix so missing states stand out immediately.

Three things that have to agree

A component exists three times: in the design file, in code, and on a documentation page. All three are used by different people, and there is no version of this where one is the source of truth and the others catch up on their own.

One component, three places

None of the three can be changed without turning the other two

There is no source of truth here, only three artefacts and a rule about when they are allowed to disagree.

  • The design file
  • The code
  • The documentation page
  • The design fileWhat a designer browses, and the only one with a picture in it
  • The codeWhat users actually meet, and the only one that can be wrong at runtime
  • The documentation pageWhat a colleague reads instead of opening either of the other two

The teeth are the same size on all three, which is the claim: none of them is the big wheel. What the figure leaves out is that they turn at different speeds, and code is usually a week ahead.

What holds is that the design file, the code and the page must say the same thing on the day anything changes. Sara's kit has one rule enforcing it: a pull request that changes a component's visible behaviour is not merged without the documentation change in the same request. It is the only reason the three do not drift, because nobody ever has time to reconcile them afterwards.

The last piece is the name. Name the component for the job, not for the screen it first appeared on: BookingCard was the name for six weeks and is now Row, because the third screen that needed it was not a booking. A name taken from the first use is the commonest reason a kit has two components that do the same thing. The bar and tabs have the same problem in a sharper form, since their names come from the furniture rather than the job: bars, tabs, menus and breadcrumbs.

The stall is a kit that only its author can use

It works. The screens built from it are consistent. The person who built it can assemble a new screen in an hour, and everybody else opens the file, cannot tell which of the two similar rows to use, and builds their own. Six months later there are three appointment rows and the kit is one of them.

The handoff stall

How a well-built kit turns into three competing appointment rows

When only the author knows which component to pick, colleagues work around the kit rather than inside it.

Silent kit fragmentation

  • 01Ambiguous names
  • 02Opens component internals
  • 03Draws a custom copy
  • 04Three rows six months later
  1. 01Ambiguous namesA teammate sees two similar rows and cannot tell which fits
  2. 02Opens component internalsStops assembling screens to reverse-engineer what a property does
  3. 03Draws a custom copySafer to build a local row than risk altering the author's version
  4. 04Three rows six months laterThe original kit becomes just one variant among workarounds

Put a stopwatch on a colleague using the kit: every time they open a component to inspect it marks a naming or documentation fault.

That is where component work stalls, and it is not a quality problem: the components are good. The tell is a stopwatch on somebody else. Hand the kit to a colleague with a screen to build and watch for the first time they open a component to see what it does. Every one of those is a naming or a documentation fault, and none of them is visible to the author, who knows.

Three slightly different hand-turned wooden cabinet knobs (walnut, muted sage-stained, oak) resting side by side in a wooden drawer tray over sage linen.
A kit only its author understands breaks down across teams: name props clearly and set obvious defaults so anyone picks the right piece.

What to open

Figma has been the default since 2019, when it took the seat from Sketch, and the parts that matter here are component properties: emphasis, size and hasIcon are declared on one component rather than drawn as separate variants, which is the difference between 6 items and 24 in the panel a colleague browses. The free tier covers a kit this size.

Tools and governance

What keeps six properties honest between Figma and live code

Figma declares properties on one component, Storybook renders real coded states, and team rules control what gets added.

A kit that outlasts its author
  • Figma propertiesDefault since 2019; turns 24 variant drawings into 6 panel items
  • Storybook live statesRunning since 2016; renders coded default, hover, focus, and disabled
  • Contribution rulesDecides who adds new components when two teams need similar layouts

Shared design tokens and reachable keyboard focus underneath

Rendering real coded components in Storybook exposes missing disabled and focus states immediately instead of hiding them in screenshots.

Storybook is the other half and it has run since 2016. It replaced a static page of screenshots that went stale, by rendering the real coded component in every state on a page anybody can open, which makes the disabled column visible rather than theoretical. It is free and open source, and it is the cheapest way to make the three artefacts above disagree loudly instead of quietly.

What none of this decides is who is allowed to add a component, and what happens when two teams need almost the same thing. That is a shared kit, and the rules for using it, and it is the question that decides whether this set survives its author leaving. Under it, the values these components are built from come from making an interface look considered, and the four states only mean anything if the focus one is reachable, which is designing for the people your defaults exclude.

Inside this, 5

Alongside this

Above this