Skip to main content
Mantı UI logoMantı UIv0.12.1
Studio

Select

Pass options as { value, label, disabled? }. Values are string arrays for both single and multiple selection.

import { Select } from '@manti-ui/react';

const regions = [
  { value: 'kayseri', label: 'Kayseri' },
  { value: 'bukhara', label: 'Bukhara' },
  { value: 'kashgar', label: 'Kashgar' },
  { value: 'yerevan', label: 'Yerevan' },
  { value: 'sarajevo', label: 'Sarajevo' },
];

export default function SelectBasic() {
  return (
    <div className="w-full max-w-[calc(var(--manti-space-16)*5)]">
      <Select items={regions} label="Region" placeholder="Pick a region…" />
    </div>
  );
}

Appearance

Use variant="fill" for a neutral filled trigger. size uses the shared size scale: the portalled listbox follows the trigger, so a sm Select opens sm rows.

Multiple selection

API

PropTypeDefaultDescription
itemsSelectItem[]The options. Each is `{ value, label, disabled? }`.
labelReactNodeOptional field label.
placeholderstring'Select…'Text shown when nothing is selected.
variant'default' | 'fill''default'Visual treatment for the trigger.
size'sm' | 'md' | 'lg''md'Control size.
multiplebooleanAllow selecting more than one option.
valuestring[]Controlled selected values.
defaultValuestring[]Initial selected values for uncontrolled usage.
onValueChange(value: string[]) => voidCalled whenever the selection changes.
placementPlacement'bottom-start'Placement of the listbox relative to the trigger.
disabledbooleanDisable the control.
invalidbooleanMark the field as invalid.
requiredbooleanMark the field as required.
namestringForm field name.
aria-labelstringAccessible name when no visible label is provided.

Styling

Anatomy

PartSelectorDescription
root[data-scope="select"][data-part="root"]The field wrapper.
label[data-scope="select"][data-part="label"]The optional field label.
trigger[data-scope="select"][data-part="trigger"]The button that opens the listbox.
value-text[data-scope="select"][data-part="value-text"]The selected value (or placeholder) text.
indicator[data-scope="select"][data-part="indicator"]The chevron on the trigger.
positioner[data-scope="select"][data-part="positioner"]The portalled wrapper positioning the listbox.
content[data-scope="select"][data-part="content"]The translucent listbox panel.
item[data-scope="select"][data-part="item"]Each selectable option.
item-indicator[data-scope="select"][data-part="item-indicator"]The checkmark shown on the selected option.

Tokens

TokenControls
--manti-select-heightheight
--manti-select-padding-xpadding x
--manti-select-font-sizefont size
--manti-select-icon-sizeicon size
--manti-select-content-max-heightcontent max height
--manti-select-content-paddingcontent padding
--manti-select-content-gapcontent gap
--manti-select-item-padding-yitem padding y
--manti-select-item-padding-xitem padding x
--manti-select-item-gapitem gap
--manti-select-item-radiusitem radius
--manti-select-item-font-sizeitem font size

Last updated

Built end-to-end with Manti UI components and design tokens. Manti UI is a framework-agnostic design system on Zag.js.

GitHub