Meridianby Commenda
Components

Select

Pick one value from a list.

A field that opens a list of options. The same frame as Input, with label, description and error built in, 40 high with a 16 value and a 14 label. On HubSpot forms it asks for country, company size and how people heard about us. To pick several, use Multi-select.

51 to 200 employees

Usage

Example.tsx
import { Select } from "@commenda/meridian/ui/select";

<Select
  label="Company size"
  placeholder="Select a company size"
  options={[{ value: "51-200", label: "51 to 200 employees" }]}
/>;

Single

The value shows in the field. The placeholder says what to pick.

51 to 200 employees

Leading flag

Countries and jurisdictions always lead with their flag. The same flag shows on the row in the list. An empty field shows no flag. Use an icon only for things that are not places.

United States
United Kingdom

Clear

clearable adds an x that empties the field. Use it on optional fields only.

(optional)
Germany

Open

The list opens 4 below the field and matches its width, with a check on the chosen row. Search turns on past about eight options. Click any field above to open its list.

States

Hover from the pointer, open while the list is up (the Input focus look), disabled for values people cannot change. Invalid shows the error under the field.

default
United States
disabled
United States
invalid
Choose your country.

Anatomy

Label row, field, then description or error, exactly as Input. Inside the field: the leading flag (always for countries), the value and the chevron.

PartValue
Field40 (control/xl), radius 8
Flag16
Value16
Chevron16
Label, description14

API reference

PropTypeDescription
labelConditionalstringFrom Pathfinder.
hideLabelbooleanFrom Pathfinder.
aria-labelConditionalstringDefines a string value that labels the current element.
requiredConditionaltrue | falseFrom Pathfinder.
labelConfigObjectView fields · 2 shapesFrom Pathfinder.
sourceConfigFieldSourceConfigView fieldsFrom Pathfinder.
descriptionstringFrom Pathfinder.
errorConfigObjectView fieldsFrom Pathfinder.
disableConfigDisableConfigView fieldsFrom Pathfinder.
optionsConditionalreadonly ChoiceOption[]From Pathfinder.
groupsConditionalreadonly ChoiceGroup[]From Pathfinder.
searchConfigConditionalObjectView fields · 2 shapesFrom Pathfinder.
paginationConfigChoicePaginationConfigView fieldsFrom Pathfinder.
selectedOptionsreadonly ChoiceOption[]From Pathfinder.
idstringFrom Pathfinder.
namestringFrom Pathfinder.
formstringFrom Pathfinder.
autoCompletestringFrom Pathfinder.
classNamestringFrom Pathfinder.
placeholderstringFrom Pathfinder.
onBlurFocusEventHandler<HTMLButtonElement>From Pathfinder.
onFocusFocusEventHandler<HTMLButtonElement>From Pathfinder.
clearConfigObjectView fieldsFrom Pathfinder.
emptyLabelstringFrom Pathfinder.
renderConfigObjectView fieldsFrom Pathfinder.
listConfigObjectView fieldsFrom Pathfinder.
addItemConfigObjectView fieldsFrom Pathfinder.
valueConditionalstringFrom Pathfinder.
onValueChangeConditional(value: string | null) => voidFrom Pathfinder.
defaultValuestringFrom Pathfinder.
labelConfigObject fields

Choose one of these 2 shapes. Don't combine fields the chosen shape excludes.

Option 1

FieldTypeDescription
optionalLabelRequiredstring

Do not supply: help.

Option 2

FieldTypeDescription
helpRequiredstring

Do not supply: optionalLabel.

sourceConfigObject fields
FieldTypeDescription
kindRequired"entity" | "record" | "document"
labelRequiredstring
previewRequiredReactNode
onOpenRequired() => void
side"top" | "bottom"
errorConfigObject fields
FieldTypeDescription
messageRequiredstring
reveal"after-blur" | "immediate"
disableConfigObject fields
FieldTypeDescription
isDisabledRequiredboolean
reasonstring
searchConfigObject fields

Choose one of these 2 shapes. Don't combine fields the chosen shape excludes.

Option 1

FieldTypeDescription
modeRequired"local"
enabledboolean
placeholderstring

Option 2

FieldTypeDescription
modeRequired"remote"
queryRequiredstring
onQueryChangeRequired(query: string) => void
resultsQueryRequiredstring
isLoadingRequiredboolean
errorstring
onRetry() => void
placeholderstring
paginationConfigObject fields
FieldTypeDescription
hasMoreRequiredboolean
isLoadingMoreRequiredboolean
onLoadMoreRequired() => void
errorstring
onRetry() => void
clearConfigObject fields
FieldTypeDescription
labelstring
renderConfigObject fields
FieldTypeDescription
optionContent(option: ChoiceOption, state: { isSelected: boolean; }) => ReactNode
selectedContent(option: ChoiceOption) => ReactNode
listConfigObject fields
FieldTypeDescription
virtualizedboolean
maxHeightnumber
addItemConfigObject fields
FieldTypeDescription
labelRequiredstring
onAddItemRequired(query: string) => void
isDisabledboolean

Best practices

  • Use Select to pick from a known list. For free text use Input. For two to five choices that should stay visible, use radios or a SegmentedControl.
  • The placeholder says what to pick ("Select a country"), never just "Select".
  • Turn on search in the list past about eight options. The country list always has search.
  • Countries and jurisdictions always lead with their flag, in the field and on each row in the list. Use an icon only for other kinds of things.
  • Match HubSpot: the options are the HubSpot property values, in the same order.
  • To pick several values, use Multi-select.
  • Source: Pathfinder Select. Meridian makes the field 40 tall with a 16 value, a 14 label and 14 help and error text.

On this page