Skip to content

Search

Articles, tools, solutions and knowledge base guides

Start typing to search across articles, tools and apps.

Component States Builder

NEW

Interaction states of buttons, form fields, switches, tabs, cards and links, from hover and keyboard focus to loading and error, checked in a state graph and against WCAG 2.2, and exported as HTML and CSS.

Free to use No registration Privacy protection

State graph

Button with text

The real component works in the middle. The nodes show every state on a light and a dark ground; the edges name the events that cause them and light up on real interaction.

Live component pointer, keyboard, touch

now: Defaultno state

    Code export

    button.css

    Browser compatibility

    Found a bug or missing something? Write to us

    Scope and limits

    What this tool covers

    Component states as standard HTML and CSS, written in your browser

    The previews are styled with the same rules and declarations as the CSS tab, inside isolated Shadow DOM trees. Contrast, the focus ring and the target size follow WCAG 2.2, browser support is tested live, and nothing is uploaded. The studio does not check your site or write the styles of the rest of your page.

    Help

    FAQ

    Which components and states does the studio cover?

    Nine families: buttons (with text, with an icon, icon only), single-line and multiline text fields, checkboxes and radio buttons, switches, dropdown lists, tabs and navigation, cards, links and a field with validation. Each one has only the states that make sense for it: hover, focus, keyboard focus, pressed, disabled, loading, success, error, selected or visited.

    What is the difference between a native and a simulated state?

    The browser sets :hover, :focus, :focus-visible, :active and :visited. The nodes of the graph show them through a data-sim attribute that copies the rule of the state, and the export does not contain it. Disabled, loading, success, error and selected are set on the element with disabled, aria-busy, data-state, aria-invalid, :checked, aria-selected or aria-pressed, exactly as in the export.

    What does the WCAG check cover?

    The contrast of text (1.4.3) and of interface parts (1.4.11) on a light and a dark ground, the focus ring (at least 3:1 and 2 px), the target size measured on the component (2.5.8), reduced motion, status messages, the accessible name and whether an error is shown by colour alone. Ratios are rounded down, and a check that fails gets the nearest colour that passes.

    Why is hover inside @media (hover: hover)?

    On a touch screen a browser can leave an element in :hover after a tap. A rule inside the query for a pointing device applies only where there is a cursor. The studio treats a preview width of 768 px or less as a touch screen, so the preview then shows the component without its :hover rule.

    Does the export match the preview?

    Yes. Every preview is its own Shadow DOM tree, styled only by a generated sheet with the same rules and declarations as the CSS tab. The only additions are what the graph needs: a copy of each pseudo-class rule for the nodes, and the dark theme colours tied to the dark ground instead of prefers-color-scheme.

    Do my settings leave the browser?

    No. The component, the checks and the code are worked out in this tab. The settings, recent configurations and view choices are kept only in this browser, under one key shared by the POLPROG studios, and in the link that is copied. An imported JSON is read as data and never executed.