• CMSnpm version

    • Overview
    • ContentBuilder
    • InviteUserForm
    • LoginForm
    • RenewPasswordForm
    • WysiwygInput
  • UInpm version

    • Overview
    • Accordion
    • AlertBubble
    • AnnouncementBar
    • Avatar
    • AvatarFileInput
    • Badge
    • Button
    • ButtonGroup
    • ButtonList
    • Calendar
    • Checkbox
    • CheckboxButton
    • CheckboxInput
    • CheckboxList
    • Chip
    • ColorRadio
    • ColorRadioGroup
    • Combobox
    • DatePicker
    • DatePickerInput
    • DateRangePicker
    • DateRangePickerInput
    • DatetimePicker
    • DatetimePickerInput
    • Dialog
    • Dropdown
    • Dropzone
    • ErrorMessage
    • FileInput
    • FlashMessages
    • FormComponent
    • Icon
    • IconButton
    • ImageGallery
    • InfoBox
    • Input
    • Label
    • Layout
    • Lightbox
    • ListItem
    • Loader
    • Lozenge
    • Menu
    • Message
    • Modal
    • ✅ ModalDialog
    • ✅ ModalHeader
    • MultiCombobox
    • MultiSelect
    • Pagination
    • Paper
    • Popover
    • Radio
    • RadioGroup
    • RasterImage
    • Select
    • Switch
    • ✅ Tabs
    • TextInput
    • TextLink
    • Textarea
    • TimePicker
    • TimePickerInput
    • Toggle
    • Tooltip
    • Typography
  • Formnpm version

    • Overview
    • AvatarFileInput
    • CheckboxButton
    • CheckboxInput
    • CheckboxList
    • ColorRadioGroup
    • Combobox
    • DatePickerInput
    • DateRangePickerInput
    • DatetimePickerInput
    • Dropzone
    • FileInput
    • Form
    • FormRenderer
    • GpsInput
    • MoneyInput
    • MultiCombobox
    • MultiSelect
    • NumberInput
    • PasswordInput
    • RadioGroup
    • Select
    • TextInput
    • Textarea
    • TimePickerInput
    • Toggle
  • DataGridnpm version

    • Overview
    • DataGrid
    • DataGridCustomExample
    • ExportButton
    • FilterList
    • Filters
    • FiltersButton
    • FulltextInput
    • HiddenColumns
    • HiddenColumnsButton
    • Pagination
    • RowCounts
    • RowsPerPageSelect
    • SelectedRowsToolbar
    • TableV2
    • ToolbarControl
    • ToolbarCustoms
    • ToolbarTabs
  • Wysiwygnpm version

    • Overview
  • Resizernpm version

    • Overview
  • Routernpm version

    • Overview
  • Corenpm version

    • Overview
  • Core-Reactnpm version

    • Overview
  • DnDnpm version

    • Overview
  • Page-Buildernpm version

    • Overview
  • Page-Builder-CMSnpm version

    • Overview
  • Page-Builder-Webnpm version

    • Overview
  • Sentrynpm version

    • Overview
  • Stylesnpm version

    • Overview
  • Localizenpm version

    • Overview
  • Analyticsnpm version

    • Overview
  • Datepickernpm version

    • Overview
  • Icons-generatornpm version

    • Overview
  • Smart-addressnpm version

    • Overview
  • E2Enpm version

    • Overview
  • E2E-Playwrightnpm version

    • Overview
View source on GitLab

Select

Single-value dropdown picker built on Base UI Select. Renders a labelled input-style trigger with a floating option list.

When to use

Reach for Select when the user picks one value from a fixed list and no text filtering is needed.

  • Need to filter options by typing? Use Combobox.
  • Need to pick multiple values? Use MultiSelect.

Use @uxf/ui/select for a controlled select outside a form. Inside a @uxf/form form, use @uxf/form/select instead — it registers the field with react-hook-form and derives isInvalid / helperText from validation. This @uxf/ui component is the controlled primitive the form twin wraps.

Usage

import { Select, SelectOption } from "@uxf/ui/select";
import { useState } from "react";

const options: SelectOption[] = [
    { id: "one", label: "Option one" },
    { id: "two", label: "Option two", disabled: true },
    { id: "three", label: "Option three" },
];

function Example() {
    const [value, setValue] = useState<string | number | null>(null);

    return (
        <Select
            label="Choose an option"
            name="example"
            onChange={setValue}
            options={options}
            placeholder="Select..."
            value={value}
        />
    );
}

value is the selected option's id (string | number) or null, and onChange is called with the new id — not the option object.

Exports: Select and the types SelectProps, SelectOption, SelectValue.

Props

SelectProps<Value = SelectValue, Option = SelectOption<Value>> extends FormControlProps<Value | null> and Clearable. SelectValue is number | string; SelectOption is { id: Value; label: ReactNode; disabled?: boolean }.

PropTypeDefaultDescription
labelReactNode—Required. Field label.
namestring—Required. Field name (also set as data-name).
valueValue | null—Required. Selected option id, or null.
onChange(value: Value | null) => void—Required. Called with the newly selected id (or null when cleared).
optionsOption[]—Required. Selectable options.
placeholderstring—Shown when no option is selected.
helperTextReactNode—Text under the control; styled as an error when isInvalid.
isClearablebooleanfalseShow a clear button that resets the value to null.
isDisabledbooleanfalseDisable the control.
isReadOnlybooleanfalsePrevent changes while staying focusable.
isInvalidbooleanfalseInvalid styling; sets aria-invalid and styles helperText as an error.
isRequiredbooleanfalseMark the field required (adds the label indicator).
hiddenLabelbooleanfalseVisually hide the label (kept for assistive tech).
renderOption(option: Option, isSelected: boolean) => ReactNodeoption.labelCustom renderer for each dropdown option.
renderSelectedOption(option: Option) => ReactNodeoption.labelCustom renderer for the selected value in the trigger.
keyExtractor(option: Option) => string | numberoption.idCustom React key for options.
noOptionsMessagestringlocalized "No items found"Empty-list message.
iconNameIconNamearrow iconIcon for the dropdown arrow.
sizeInputGroupSize"default""small", "default", or "large".
variantInputGroupVariant"default"Input group variant.
idstringauto (useId)Root id; the error-message id derives from it.
onBlur / onFocusFocusEventHandler<HTMLInputElement>—Focus handlers.

Layout, dropdown, and ref props: className, style, form, leftAddon, rightAddon, leftElement, rightElement, inputArrow, dropdownClassName, dropdownEndContent, dropdownMatchesInputWidth (default true), dropdownMaxHeight (default 240), dropdownPlacement (default "bottom"), dropdownStrategy, inputRef, inputGroupRef, inputWrapperRef.

Variants & states

  • Sizes: small, default, large (via size).
  • Invalid: set isInvalid; combine with helperText to show an error message.
  • Disabled / read-only: isDisabled blocks all interaction; isReadOnly keeps focus but prevents changes.
  • Clearable: with isClearable, a remove button appears once a value is selected (unless disabled/read-only).
  • Dropdown placement: dropdownPlacement="top" flips the list above the input; Floating UI auto-flips on collision.
  • Content below the options: dropdownEndContent pins content (typically an "add a new item" button) below the options. It stays visible while the list scrolls and when nothing matches, fits inside dropdownMaxHeight together with the list, and is not part of the arrow-key navigation. Static content (ReactNode) leaves the dropdown open; the function form (args) => ReactNode gets args.close(), which closes the dropdown without changing the value.

Requirements

The component composes the input, label, dropdown, form-component, and icon primitives, so import all of their stylesheets once in your global CSS:

@import url("@uxf/ui/css/icon.css");
@import url("@uxf/ui/css/dropdown.css");
@import url("@uxf/ui/css/label.css");
@import url("@uxf/ui/css/form-component.css");
@import url("@uxf/ui/css/input-basic.css");
@import url("@uxf/ui/css/input.css");
@import url("@uxf/ui/css/select.css");

Also requires the global @uxf/ui token layer, set up once per app — see @uxf/ui setup.

ComponentStructure
Open in new tab
Default
Open in new tab
DropdownEndContent
Open in new tab
OnlyForE2ETests
Open in new tab
Sizes
Open in new tab
States
Open in new tab