Docplanner Logo

Docplanner Mobile UI

Edit page
Introduction
⚙️ – Core
⚛️ – Atoms-Molecules
AvatarBadgeButtonCheckBoxFieldCircleDividerDownloadCardIconInputFieldInputFieldButtonLinkListItemOneTimeCodeInputPhotoAvatarRadioGroupFieldRatingSelectFieldPropertiesBasic usageCompactCompact with a custom selectionExtractorWith initial valueWith an errorWith an option prefixed elementSimpleAvatarSpacerSwitchFieldTextToast❌ Icon (Deprecated)❌ Roboto (Deprecated)❌ WorkSans (Deprecated)
🧬 – Organisms

SelectField

A standard component to let a user pick one of the provided options.

Properties

compact
boolean | undefined

Determines whether it’s a caret icon or a text saying ‘Select’ on the right

shouldConfirm
boolean | undefined

Whether users needs to confirm their selection

error
string | undefined

If presents shows the message under the select and makes the border and label change color to red

keyExtractor
((item: Item) => string) | undefined

Prop passed through directly to the modal’s FlatList. If not provided, labelExtractor is used.

label
string
required

Label

labelExtractor
(item: Item) => string
required

Function that takes in an option item and returns a label displayed in the list

modalSubtitle
string | undefined

Modal subtitle

modalTitle
string | undefined

Modal title

onChange
(value: string) => void
required

Regular input onChange handler

onGoBack
(() => void) | undefined

Callback fired when the close icon is pressed

options
Item[]
required

Data representing the options

renderOptionPrefix
((item: Item) => ReactNode) | undefined

An element to render before each option in the options list

selectionExtractor
((item: Item) => string) | undefined

Function that takes in an the selected item and returns a string displayed as the selected value If not providerd, labelExtractor is used.

value
string | undefined

Selected value

valueExtractor
(item: Item) => string
required

Function that takes in an option item and returns a value that’s later passed to onChange

Basic usage

Compact

Uses a caret icon instead of a 'Select' link to open the modal

Compact with a custom selectionExtractor

The selected value is displayed differently than shown on the list initially.

With initial value

With an error

With an option prefixed element