Skip to content

Tag input

Type to add tags as removable chips. Enter or comma adds, Backspace removes, pasted lists are split.

CSS + mian.js JSON Markdown Registry item

Tags

Design Accessibility

Press Enter or comma to add.

Installation

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

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

Prefer to own the files? /r/tag-input.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-tag-inputWrapper around chips and one input. Add mn-input to style it as a field.
data-name="tags"Adds hidden inputs named tags[] for form submission.
data-max="5"Maximum number of tags.

Accessibility

  • Give the input a label (visible, or aria-label). Each chip’s remove button is labelled “Remove …”.
  • Additions and removals are announced in a polite live region.
  • Emits mn:change with { values }.
Choose a noodle

Minimal

Flat

Pixel

Linear

Thin

Glass

Textured

Bold

Elegant

Rounded

On this page