Utilização

Switch between day, week and month

Este tipo é usado por 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>
  );
}

Declaração do tipo

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;
};

Membros 4

NomeTipoObrigatórioDescrição
optionsSelectOption[]SimA segment each, in order; each value names one option.
valuestringNãoThe 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.
disabledbooleanNão—
onChange(value: string) => voidNãoThe value of the segment the user picked.
onChange — assinaturas de método

Assinaturas

ts
(value: string): void

Parâmetros

NomeTipoObrigatórioDescrição
valuestringSim—

Devolve

void

Gerado a partir das declarações TypeScript públicas: assinaturas, props e predefinições vêm da fonte verificada, as descrições da sua JSDoc. Nenhuma predefinição é inventada.