Skip to content

Address field with autocomplete

A French address input with suggestions from the national address database (no API key), by keyboard or mouse, filling street, postcode and city.

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

Description

A mistyped address means a lost parcel. This field queries the French national address database through the Géoplateforme public geocoding service (free, no key, open CORS) from 3 characters, with a 250 ms delay and cancellation of outdated requests. The 5 suggestions appear in a list following the ARIA combobox pattern (aria-expanded, aria-activedescendant): arrows, Enter and Escape on the keyboard, click with the mouse. The chosen address fills the street, postcode and city fields, which stay editable. If the service does not answer or finds nothing, an aria-live message asks to fill the fields by hand: the form is never blocked. On submit, the 5-digit postcode and required fields are checked, with linked messages and focus on the first error. Labelled native fields with autocomplete (browser autofill works too), 44 px options, AA contrast in light and dark mode, no horizontal scrolling from 360 px. Example: the delivery address of an online shop.

Code

Loading the code…

The code of this component in

Archive contents

champ-adresse-autocompletion-html-tailwind.zip3 files · 6 Ko

  • index.html13 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