Verwendung

Switch between day, week and month

Dieser Typ wird verwendet von SegmentedControl

tsx
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

ts
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

NameTypErforderlichBeschreibung
optionsSelectOption[]JaA segment each, in order; each value names one option.
valuestringNeinThe 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.
disabledbooleanNein—
onChange(value: string) => voidNeinThe value of the segment the user picked.
onChange — Methodensignaturen

Signaturen

ts
(value: string): void

Parameter

NameTypErforderlichBeschreibung
valuestringJa—

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.