Components

Select

v1.0.0

Dropdown select input for choosing one option from a list.

Import

import { Select } from '@meteorack/sdk-react';

How To Use It

  • Use it when the user must choose a single option from a known list of values.
  • Prefer select inputs over freeform text when the valid values are fixed and you want to reduce validation errors.

Works Well With

Props

options: SelectOption[]

Available choices; each option has a value and label.

value?: string

Currently selected option value.

onChange?: (value: string) => void

Called when the selected value changes.

placeholder?: string

Fallback text shown when no value is selected.

disabled?: boolean

Disables the trigger and selection list.

className?: string

Optional class name for the trigger element.

Example

Select.tsx
import { useState } from 'react';
import { Select } from '@meteorack/sdk-react';

const options = [
  { value: 'daily', label: 'Daily' },
  { value: 'weekly', label: 'Weekly' },
  { value: 'monthly', label: 'Monthly' },
];

export function ReportScheduleField() {
  const [schedule, setSchedule] = useState('weekly');

  return (
    <Select
      options={options}
      value={schedule}
      onChange={setSchedule}
      placeholder="Select schedule"
    />
  );
}