Forms

Select

An accessible select dropdown component with support for options, groups, and custom styling. Designed for healthcare forms requiring patient data selection.

Basic Usage

Standard select dropdowns for choosing from predefined options like insurance providers.

With Placeholder

Use placeholders to guide users when no option is selected.

With Icons

Icons help users quickly identify the purpose of the select field.

Validation States

Show validation feedback to guide users in making required selections. Use validateOnMount to show validation state immediately. Try selecting/clearing values to see reactive updates.

Sizes

Choose appropriate sizes based on form density and importance.

Disabled State

Disable selects when options are not available or the field is not applicable.

Option Groups

Group related options together for better organization, especially useful for large lists.

Props

PropTypeDefaultDescription
id stringUnique identifier for the select
name stringForm field name
label *stringLabel text for the select
value string''Current value
placeholder string'Select an option'Placeholder text
options *SelectOption[] | SelectGroup[]Array of options or option groups
required booleanfalseWhether the field is required
disabled booleanfalseWhether the field is disabled
error stringError message to display (shows red border and error icon)
successMessage stringSuccess message when valid (shows green border and check icon)
hint stringHint text to display below the select
size 'sm' | 'md' | 'lg''md'Size of the select
hideLabel booleanfalseWhether to hide the label visually (still accessible)
class stringAdditional CSS classes for the wrapper
iconLeft SnippetIcon to display on the left
onchange (event: Event) => voidChange handler
onblur (event: FocusEvent) => voidBlur handler
testId stringTest ID for e2e testing (Playwright, Cypress)
validateOnMount booleanfalseShow validation state immediately without waiting for user interaction

Healthcare Best Practices

  • • Always provide clear, descriptive labels for select fields (e.g., "Primary Insurance Provider" instead of "Insurance")
  • • Use option groups to organize large lists of providers, specialties, or insurance plans
  • • Validate required selections before form submission, especially for insurance and provider fields
  • • Include helpful hint text for complex selections like insurance plan types or appointment categories
  • • Disable selects when data is being loaded or when selections are not applicable to the current context
  • • Use consistent option ordering (alphabetical for providers, logical grouping for appointment types)
  • • Ensure all select options are accessible via keyboard navigation for compliance with healthcare accessibility standards