Skip to content

Swatch picker

Pick a colour (or any visual option) from round swatches. Real radio buttons underneath.

Colours

Colour

Installation

Everything ships in one stylesheet. There is nothing to import per component.

<link rel="stylesheet" href="https://mian.ro/dist/mian.css">

Prefer to own the files? /r/swatch-picker.json is a registry item with this component's CSS and example markup, ready to copy into your project with any tool that reads the open registry-item format.

Class reference

Class / attributeDescription
mn-swatchesA fieldset of options.
mn-swatch-optionA label with a radio inside; set --sw to its colour.
mn-swatches-sm · mn-swatches-squareSmaller or square swatches.

Accessibility

  • Each radio needs an accessible name (aria-label), colour alone is not a name.
  • Arrow keys move between options, as with any radio group; focus shows a ring.
Choose a noodle

Minimal

Flat

Pixel

Linear

Thin

Glass

Textured

Bold

Elegant

Rounded

On this page