SegmentedControlProps
Props of SegmentedControl: a segment per option, and the chosen value.
Verwendung
Switch between day, week and month
Dieser Typ wird verwendet von SegmentedControl
import { SegmentedControl, Text, VStack, signal } from 'kuito';
const VIEWS = [
{ value: 'day', label: 'Day' },
{ value: 'week', label: 'Week' },
{ value: 'month', label: 'Month' },
];
export default function Plan() {
const view = signal('week');
return (
<VStack gap={8} padding={16}>
<SegmentedControl label="View" options={VIEWS} value={view} height={32} />
<Text>{view.value}</Text>
</VStack>
);
}Typdeklaration
export type SegmentedControlProps = {
/** A segment each, in order; each value names one option. */
options: SelectOption[];
/**
* The chosen segment's value; none selected while it names no option.
* Two-way when given a signal: the control writes it as the user picks.
*/
value?: string;
disabled?: boolean;
/** The value of the segment the user picked. */
onChange?: (value: string) => void;
};Mitglieder 4
| Name | Typ | Erforderlich | Beschreibung |
|---|---|---|---|
options | SelectOption[] | Ja | A segment each, in order; each value names one option. |
value | string | Nein | The chosen segment's value; none selected while it names no option. Two-way when given a signal: the control writes it as the user picks. |
disabled | boolean | Nein | — |
onChange | (value: string) => void | Nein | The value of the segment the user picked. |
onChange — Methodensignaturen
Signaturen
(value: string): voidParameter
| Name | Typ | Erforderlich | Beschreibung |
|---|---|---|---|
value | string | Ja | — |
Rückgabe
void
Generiert aus den öffentlichen TypeScript-Deklarationen: Signaturen, Props und Standardwerte stammen aus der geprüften Quelle, Beschreibungen aus deren JSDoc. Kein Standardwert ist erfunden.