Skip to main content
Version: latest
Works everywhere

Select works in both server and client environments. Always use the standard import (e.g. @prokodo/ui/select) — the library detects the runtime automatically.

Select

Select renders an accessible dropdown with optional search filtering, option grouping, multi-select, and async remote option loading.

Live demo →

Overview

import { Select } from "@prokodo/ui/select"
;<Select
name="country"
label="Country"
options={[
{ label: "Germany", value: "de" },
{ label: "Austria", value: "at" },
]}
value={country}
onChange={setCountry}
/>

Import

import { Select } from "@prokodo/ui/select"

CSS:

import "@prokodo/ui/select.css"

Props

PropTypeDefaultRequiredDescription
idstringHTML id for the select (required for accessibility).
itemsSelectItem[]Selectable options.
labelstringSelect label text.
namestringName for form submission.
valuestring | string[]Controlled selected value(s).
defaultValuestring | string[]Uncontrolled initial value(s).
placeholderstringPlaceholder text when nothing is selected.
multiplebooleanfalseAllow multiple selections.
disabledbooleanfalseDisable the select.
requiredbooleanfalseMark field as required.
fullWidthbooleanfalseStretch to container width.
iconVisiblebooleantrueShow/hide the dropdown chevron icon.
colorVariantsAccent color variant.
helperTextstringHelper text shown below the select.
errorTextstringError message (also sets error state).
fieldClassNamestringCSS class on the field wrapper.
selectClassNamestringCSS class on the <select> element.
labelPropsLabelPropsProps forwarded to the label.
onChange(e: SelectEvent, value: SelectValue) => voidCalled when selection changes.
classNamestringCSS class on root element.

See src/components/select/Select.model.ts for the full SelectProps type.


Design Tokens

Customise Select via CSS custom properties on :root or a scoped ancestor.

TokenDefaultDescription
--pk-select-bgvar(--pk-color-surface)Trigger background
--pk-select-fgvar(--pk-color-fg)Trigger text colour
--pk-select-fg-mutedvar(--pk-color-muted)Secondary / muted text
--pk-select-fg-placeholdervar(--pk-palette-grey-500)Placeholder text colour
--pk-select-label-fgvar(--pk-color-brand)Floating label colour
--pk-select-label-bgvar(--pk-color-surface)Label notch background
--pk-select-radiusvar(--pk-radius-pill)Trigger corner radius
--pk-select-shadowvar(--pk-shadow-sm)Trigger box-shadow
--pk-select-listbox-shadowvar(--pk-shadow-lg)Dropdown panel shadow
--pk-select-gradient-fromvar(--pk-color-brand)Focus gradient start
--pk-select-gradient-tovar(--pk-color-accent)Focus gradient end
--pk-select-item-hover-bgvar(--pk-palette-primary-50)List item hover background
--pk-select-item-active-bgvar(--pk-palette-primary-100)Selected item background
--pk-select-padding-xvar(--pk-space-lg)Trigger horizontal padding
--pk-select-padding-y0.875remTrigger vertical padding

AIC Note

Use the standard import path in application code:

import { Select } from "@prokodo/ui/select"

No separate /client or /lazy import selection is required in consumer code.

AIC components also support a priority flag for critical above-the-fold elements. This is most visible on Image (native preloading via <link rel="preload"> for above-the-fold content).


WCAG 2.2 Status

CriterionNameStatusNote
1.3.1Info and Relationships (A)✅ FulfilledSemantic structure (headings, lists, labels, landmarks) must be conveyed programmatically via HTML or ARIA.
1.3.5Identify Input Purpose (AA)🔍 Manual reviewForm fields collecting personal data must expose their purpose via the HTML autocomplete attribute.
2.1.1Keyboard (A)✅ FulfilledAll functionality must be operable via keyboard alone, without requiring specific timing.
2.1.2No Keyboard Trap (A)🔍 Manual reviewKeyboard focus must never become trapped inside a component; users must always be able to navigate away using standard keys.
2.4.3Focus Order (A)🔍 Manual reviewThe keyboard focus sequence must preserve meaning and operability in the complete page integration context.
2.4.7Focus Visible (AA)🔍 Manual reviewA visible keyboard focus indicator must be present on every interactive element. Verify against the applied product theme.
2.4.11Focus Not Obscured (Min.) (AA)🔍 Manual reviewThe focused component must not be fully hidden by sticky headers, overlays, or other positioned page elements.
3.3.1Error Identification (A)🔍 Manual reviewInput errors must be identified and described to the user in text, not by colour alone.
3.3.2Labels or Instructions (A)✅ FulfilledEvery form input requires a programmatically associated label or a visible instruction.
4.1.2Name, Role, Value (A)✅ FulfilledName, role, and state of all interactive UI components must be programmatically determinable via native HTML semantics or ARIA.
4.1.3Status Messages (AA)✅ FulfilledStatus messages (loading, success, error, progress) must reach assistive technologies without a focus change (aria-live or role='status').

Test coverage: 3 jest-axe assertion(s) across 5 test file(s) · 10 ARIA attribute occurrence(s) in source scan. Criteria marked 🔍 require manual verification in the final product integration and theme context.

Storybook

👉 Open Select in Storybook


Source

src/components/select/Select.model.ts