Skip to main content

Autocomplete

A text input that displays suggestions as the user types while allowing users to enter any value. When the value must be selected from a predefined list, use Select. If you need more advanced features, use Combobox.

Base
Mantine + override
Import
{ Autocomplete } from '@mantine/core'
Source
src/themes/theme.ts
src/themes/style-overrides/combobox.module.css

Usage​

disabled
size
sm
md
lg
React
<Autocomplete label="Kommune" placeholder="Søk etter kommune" size="md" data={['Oslo', 'Bergen', 'Trondheim', 'Stavanger']} />

The field follows TextInput and the dropdown follows Select. Text that matches the search is highlighted with --mantine-color-surface-highlight.

Props​

Only what this design system changes. Everything else is Mantine's — read the full props table there.

PropertyTypeAllowed valuesDefaultDescription
sizeMantineSizesm · md · lgmdSets the field height.
comboboxPropsComboboxProps—{ transitionProps: { transition: 'fade-down', duration: 150 } }Configures the dropdown. The default sets the motion. Shared with the other comboboxes.

Accessibility​

Give the field a label. See Accessibility for what applies to every component.