Skip to content
Inputs & Forms

Select

client73 kB
@stellaria/nebula-webSelectProps

Preview

Props

21
PropTypeDefault

className

string

—

data

required
readonly SelectOption[]

—

defaultValue

string""

description

ReactNode

—

disabled

booleanfalse

emptyLabel

string

—

error

string | boolean

—

errorDisplay

ErrorDisplay"tooltip"

field

NebulaField<string>

—

label

ReactNode

—

maxDropdownHeight

number

—

name

string

—

onChange

((value: string) => void)

—

placeholder

string"Select an option"

placement

PopoverPlacement"bottom start"

renderOption

RenderOption

—

required

booleanfalse

rootClassName

string

—

size

Size"md"

surface

FieldSurface"outline"

value

string

—

Slot props

10

Each one spreads over an inner element, so you can restyle a region without forking the component.

PropTypeDefault

bodyProps

Wrapper for the control.

BoxSlotProps

—

chevronProps

The chevron. It carries `data-open`, which is where its rotation comes from.

BoxSlotProps

—

descriptionProps

Help text below the label. Only rendered with `description`.

TextSlotProps

—

dropdownProps

The dropdown, which is the motion wrapper of the floating surface and does not go through `Box`: it does not accept style props. Its width and position are written after the slot and are not overridden; the `style` you pass composes with them.

OverlayMotionSlotProps

—

errorProps

Configures the `FieldError`. With `errorDisplay="tooltip"` it spreads whole; with `"text"` there is no `FieldError` to configure — it is a `Text` with `role="alert"` — and only `className` is honoured.

Omit<FieldErrorProps, "children">

—

headerProps

The label and description row. Not rendered when the field has neither.

BoxSlotProps

—

labelProps

The field label. It lands on the `<label>`, which already carries the control `htmlFor`.

TextSlotProps

—

requiredProps

The required asterisk, which lives inside the label. Only rendered with `required`.

BoxSlotProps

—

triggerProps

The button that opens the list.

Omit<DetailedHTMLProps<ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref">

—

valueProps

The value shown in the button. It carries the placeholder style when there is no selection.

BoxSlotProps

—

Also accepts

On top of its own props, this component forwards these groups.

Style props · 127