Skip to main content

Props reference

Select

The component is a discriminated union: SingleProps when multiple is omitted/false, MultiProps when multiple is true. TypeScript narrows value / onValueChange automatically.

Common props (SelectBaseProps)

PropTypeDefaultDescription
optionsSelectOption[]The option list.
searchablebooleanmultiple ‖ options.length > 5Show the search field.
placeholderstringTrigger text when empty.
searchPlaceholderstringSearch field placeholder.
emptyTextstringEmpty-results message.
disabledbooleanfalseDisables the trigger.
mobileTitlestringplaceholderSheet header title.
mobileSetLabelstring"Set"Multi confirm button aria-label.
mobileCancelLabelstring"Cancel"Cancel button aria-label.
mobileDoneLabelstring"Done"Single-select close button aria-label.
selectedCountLabel(n: number) => string${n} selectedTrigger summary when > 2 selected (multi).
classNamestringExtra class on the trigger.
aria-labelstringAccessible label for the trigger.

Single-select (SingleProps)

PropType
multiplefalse (optional)
valuestring
onValueChange(v: string) => void

Multi-select (MultiProps)

PropType
multipletrue
valuestring[]
onValueChange(v: string[]) => void

SelectOption

type SelectOption = {
value: string; // unique key
label: string; // row label
description?: string; // secondary text + folded into aria-label
disabled?: boolean; // row is not toggleable
icon?: ReactNode | ((option: SelectOption) => ReactNode); // leading icon
};

Exported helpers

The pure logic is exported for advanced consumers building a custom UI on the same primitives:

  • OPTION_ROW_HEIGHT, OPTION_OVERSCAN, computeVirtualOptionRange, optionListSignature (from select-virtual)
  • computeMobileSheetLayout (from select-layout)

TypeScript example

import { Select, type SelectOption, type SingleProps, type MultiProps } from "react-ios-multiselect";

// single — value is string
const single: SingleProps = {
value: "put",
onValueChange: (v: string) => {},
options: [] as SelectOption[],
};

// multi — value is string[]
const multi: MultiProps = {
multiple: true,
value: ["AAPL"],
onValueChange: (v: string[]) => {},
options: [] as SelectOption[],
};