Skip to Content
Nextra 4.0 is released 🎉

Select

The Select component provides a pixel-art styled dropdown input for choosing from a list of options.
Designed to fit seamlessly into the retro aesthetic of PixelartUI, it supports labels, helper text, error states, and customizable styles.
With flexible sizing, themes, and interactive behavior, the Select component offers a consistent and expressive way to present menus and option lists.


🚀 Usage

Basic Example


Vehicle
Car
Lorry
Bike
Motorbike
<Select display="Vehicle" options={[ { label: "Car", value: "car", }, { label: "Lorry", value: "lorry", }, { label: "Bike", value: "bike", }, { label: "Motorbike", value: "motorbike", }, ]} selectLabel="My Select" selectName="my-select" type="main" />

Select Type


Vehicle
Car
Lorry
Bike
Motorbike
Vehicle
Car
Lorry
Bike
Motorbike
<Select display="Vehicle" options={[ { label: "Car", value: "car", }, { label: "Lorry", value: "lorry", }, { label: "Bike", value: "bike", }, { label: "Motorbike", value: "motorbike", }, ]} selectLabel="My Select" selectName="my-select" type="main" /> <Select display="Vehicle" options={[ { label: "Car", value: "car", }, { label: "Lorry", value: "lorry", }, { label: "Bike", value: "bike", }, { label: "Motorbike", value: "motorbike", }, ]} selectLabel="My Select" selectName="my-select" type="inline" />

Select No Label


Vehicle
Car
Lorry
Bike
Motorbike
<Select display="Vehicle" options={[ { label: "Car", value: "car", }, { label: "Lorry", value: "lorry", }, { label: "Bike", value: "bike", }, { label: "Motorbike", value: "motorbike", }, ]} selectLabel="My Select" selectName="my-select" type="main" noLabel />

Select custom size


Vehicle
Car
Lorry
Bike
Motorbike
<Select display="Vehicle" options={[ { label: "Car", value: "car", }, { label: "Lorry", value: "lorry", }, { label: "Bike", value: "bike", }, { label: "Motorbike", value: "motorbike", }, ]} selectLabel="My Select" selectName="my-select" type="main" width="700px" height="150px" />

Select fullwidth


Vehicle
Car
Lorry
Bike
Motorbike
<Select display="Vehicle" options={[ { label: "Car", value: "car", }, { label: "Lorry", value: "lorry", }, { label: "Bike", value: "bike", }, { label: "Motorbike", value: "motorbike", }, ]} selectLabel="My Select" selectName="my-select" type="main" fullwidth />

Select disabled


Vehicle
Car
Lorry
Bike
Motorbike
<Select display="Vehicle" options={[ { label: "Car", value: "car", }, { label: "Lorry", value: "lorry", }, { label: "Bike", value: "bike", }, { label: "Motorbike", value: "motorbike", }, ]} selectLabel="My Select" selectName="my-select" type="main" disabled />

Select error


Vehicle
Car
Lorry
Bike
Motorbike
<Select display="Vehicle" options={[ { label: "Car", value: "car", }, { label: "Lorry", value: "lorry", }, { label: "Bike", value: "bike", }, { label: "Motorbike", value: "motorbike", }, ]} selectLabel="My Select" selectName="my-select" type="main" error />

Select custom color


Vehicle
Car
Lorry
Bike
Motorbike
<Select display="Vehicle" options={[ { label: "Car", value: "car", }, { label: "Lorry", value: "lorry", }, { label: "Bike", value: "bike", }, { label: "Motorbike", value: "motorbike", }, ]} selectLabel="My Select" selectName="my-select" type="main" backgroundColor="#b13737" />

Select styles


Vehicle
Car
Lorry
Bike
Motorbike
Vehicle
Car
Lorry
Bike
Motorbike
<Select display="Vehicle" options={[ { label: "Car", value: "car", }, { label: "Lorry", value: "lorry", }, { label: "Bike", value: "bike", }, { label: "Motorbike", value: "motorbike", }, ]} selectLabel="My Select" selectName="my-select" type="main" selectStyle="dark" /> <div className="cp-dark-bg"> <Select display="Vehicle" options={[ { label: "Car", value: "car", }, { label: "Lorry", value: "lorry", }, { label: "Bike", value: "bike", }, { label: "Motorbike", value: "motorbike", }, ]} selectLabel="My Select" selectName="my-select" type="main" selectStyle="light" /> </div>

đź”§ Props

PropTypeDefaultDescription
typeSelectType—Determines the Select’s visual and interaction style.
backgroundColorstringundefinedSets a custom background color for the Select container.
optionsSelectOption[]—List of selectable options displayed in the dropdown.
displaystring—The text shown when no option is selected or for the current display label.
selectNamestring—A unique name identifier for the Select input.
selectLabelstring—Label text displayed above the Select component.
noLabelbooleanfalseHides the label when set to true.
disabledbooleanfalseDisables the Select input and visually signals inactivity.
errorbooleanfalseDisplays the Select in an error state.
classNamestringundefinedAdds additional CSS classes for custom styling.
selectStyleSelectStyleundefinedApplies a predefined PixelartUI style or theme to the Select component.
widthstringundefinedSets a custom width (e.g., "200px", "100%").
heightstringundefinedSets a custom height for the Select.
fullwidthbooleanfalseExpands the Select to fill the width of its container.
onChange(event: React.MouseEvent<HTMLDivElement, MouseEvent>) => voidundefinedCallback fired when an option is clicked / selected.
Last updated on