Interactive tool

Build focus states keyboard users can actually see

Set the colour, width, gap and glow of a focus ring, then tab to the two sample buttons to see it on a light and a dark background. The tool writes the CSS for you to copy.

How-To Guide

Building a focus ring that survives contact with real browsers

Focus Ring Architect builds the CSS for a focus indicator that stays visible against whatever background it lands on. This guide is for anyone shipping components who has watched a keyboard user lose track of where they are on a page. The tool works out no contrast ratio, so check the ring colour against each background it will sit on with a contrast checker.

Level: Intermediate
Best for: Front-end and product designers who own component states
Focus Ring Architect interface showing a button with a generated focus outline and its contrast ratio
  1. Set the element states

    Note which interactive elements, buttons, links, form fields, need a visible ring and what background colour sits behind each one.

  2. Shape the ring

    Adjust the ring's colour, thickness and offset until it stays clear of the element's edge on every background you're testing against.

  3. Check the contrast and copy the CSS

    Check the ring colour against its background with a contrast checker, aiming for at least 3:1, then copy the CSS into your stylesheet.

Focus Ring Architect

Build a two layer focus ring: a transparent outline that keeps a focus indicator visible in Windows High Contrast Mode, plus a box shadow ring on top. Set the gap colour to match whatever surface the element actually sits on, then tab to the two preview buttons below to see the real result.

Ring settings
3px
3px
6px

Generated CSS

Try it: tab to these buttons

Each preview injects its own surface colour as the gap, so both are honestly correct: the light panel uses the light surface colour, the dark panel uses the dark surface colour.

Light surface

Dark surface

Free Tools

See your focus ring the way a keyboard user will, before you ship it.

Focus Ring Architect lets you set a ring's colour, width and glow, and the size and colour of the gap between the ring and the element. It's built for anyone shipping a keyboard-navigable interface, from a single button to a full design system. The preview shows you what the ring will look like, not whether it meets a specific accessibility standard, so it's worth checking the numbers against your own criteria before you rely on them.

No sign-up, works on any device, always free.