Skip to content

Tag input

A field to type several tags with the keyboard: Enter or comma to add, cross or Backspace to remove, with duplicates and a maximum handled.

  • Tailwind
  • React
  • CSS
  • WordPress
Open in a new tab

Description

For skills, interests, listing keywords or allergies: the visitor types a word then Enter or a comma, and a tag appears in the field. A pasted list (“Stairs, Parquet, Kitchen fitting”) becomes several tags at once, the first letter is capitalised and extra spaces disappear. Duplicates are refused whatever the case, and beyond the maximum a message explains what to do. Each tag has a named “Remove …” button, and Backspace in the empty field removes the last one; after a removal, focus returns to the field. Every action is announced in a role="status" region (“Cabinetmaking added. 3 of 6.”) and a hidden field sends the comma-separated list with the form. The whole frame takes the focus outline, and clicking in the empty space puts the caret in the field. 32 px remove buttons in 36 px tags, AA contrast in light and dark mode, natural wrapping at 360 px.

Code

Loading the code…

The code of this component in

Archive contents

champ-etiquettes-saisie-html-tailwind.zip3 files · 5 Ko

  • index.html8 Ko
  • README.md4 Ko
  • LICENSE.md1 Ko

Tags

Updated on December 2, 2026.

Reviews

No reviews yet.

In the same spirit

  • A recruitment form for small businesses: target position, introduction, CV checked in the browser and GDPR consent, with inline errors.

    • Tailwind
    • React
    • CSS
    • WordPress
    Component
  • A quote request form whose labels, hints and error messages are full French sentences, still readable at 320 px: nothing overflows, nothing is cut off, and each error is tied to its field.

    • Tailwind
    • React
    • CSS
    • WordPress
    Component
  • Visitors pick a package and tick options: the pre-tax total, VAT and total including tax update live, and the summary is sent with the contact form.

    • Tailwind
    • React
    • CSS
    • WordPress
    Component
  • A short NPS survey: a 0 to 10 score as radio buttons, then a follow-up question adapted to whether the customer is a detractor, passive or promoter.

    • Tailwind
    • React
    • CSS
    • WordPress
    Component