FSAI Design System
Components

Address Input

Address search field built on Input with Mapbox-powered autocomplete suggestions.

Overview

AddressInput is the shared address search field used when the user should search for and select a real address suggestion rather than type freeform location text only.

It composes:

  • Input
  • Mapbox address-autofill search
  • a floating suggestions list

Use it when selecting an address should also produce structured address metadata such as city, state, postcode, and coordinates.

Basic Usage

<AddressInput
  label="Address"
  value={address}
  onChange={setAddress}
  onSelectSuggestion={(result) => {
    setValue('address', result.address_1 ?? '');
    setValue('city', result.city ?? '');
    setValue('state', result.state ?? '');
    setValue('postcode', result.postcode ?? '');
  }}
/>

What onSelectSuggestion Returns

When a suggestion is chosen, onSelectSuggestion receives structured data including:

  • coordinates
  • address_1
  • address_2
  • city
  • state
  • postcode
  • country

That makes AddressInput a good fit for forms that need both a visible address string and separate normalized address fields.

Props

PropTypeDefaultDescription
valuestringCurrent address text.
onChange(value: string) => voidCalled when the text input changes.
onSelectSuggestion(result) => voidCalled with structured address data when a suggestion is selected.
errorstringField error text.
labelstringField label.
placeholderstring'Enter address...'Placeholder text.
classNamestringAdditional input classes.
labelIconIconNameOptional icon next to the label.

Brand Dashboard Usage

PatternPathNotes
Brand intake address entryfsai/apps/brand-dashboard/src/pages/GettingStarted/BrandIntake/BrandIntake.tsxFull form field with structured address capture.
Shared details-grid address editingfsai/packages/shared-ui/src/components/DetailsGrid/DetailsGrid.components.tsxUsed to populate multiple address fields from a suggestion.
Map search and pin placementfsai/packages/shared-ui/src/modules/locations/components/LocationsMap/LocationsMap.tsxAddress search drives map positioning and selection.

Important Cautions

  • AddressInput depends on the Mapbox address-autofill integration and MAPBOX_PUBLIC_TOKEN.
  • Free typing and selecting a suggestion are not the same thing. If the form needs structured address data, rely on onSelectSuggestion.
  • Suggestions are debounced and fetched asynchronously, so treat this as a search field, not a static input.

Guidelines

  • Do use AddressInput when address selection should also fill structured address fields or coordinates
  • Do use plain Input instead when you only need an arbitrary text location field
  • Do handle onSelectSuggestion if the surrounding form depends on normalized address data
  • Don't assume typed text alone has been validated as a real address

On this page