Usage

Choose a future due date

This type is used by DatePicker

tsx
import { DatePicker, Text, VStack, signal } from 'kuito';

export default function Due() {
  const due = signal(Date.now());

  return (
    <VStack gap={8} padding={16}>
      <DatePicker label="Due" type="datetime" value={due} min={Date.now()} height={44} />
      <Text>{new Date(due.value).toLocaleString()}</Text>
    </VStack>
  );
}

Type declaration

ts
export type DatePickerProps = {
  /**
   * The moment shown, in milliseconds since 1970 (`date.getTime()`); now
   * when unset. Two-way when given a signal: the picker writes it as the
   * user picks.
   */
  value?: number;
  /** `date` by default. A pick keeps the part of the moment its type doesn't show. */
  type?: DatePickerType;
  /** The earliest moment the user can pick, in milliseconds. */
  min?: number;
  /** The latest moment the user can pick, in milliseconds. */
  max?: number;
  disabled?: boolean;
  /** The moment the user picked, in milliseconds. */
  onChange?: (value: number) => void;
};

Members 6

NameTypeRequiredDescription
valuenumberNoThe moment shown, in milliseconds since 1970 (date.getTime()); now when unset. Two-way when given a signal: the picker writes it as the user picks.
typeDatePickerTypeNodate by default. A pick keeps the part of the moment its type doesn't show.
minnumberNoThe earliest moment the user can pick, in milliseconds.
maxnumberNoThe latest moment the user can pick, in milliseconds.
disabledbooleanNo—
onChange(value: number) => voidNoThe moment the user picked, in milliseconds.
onChange — method signatures

Signatures

ts
(value: number): void

Parameters

NameTypeRequiredDescription
valuenumberYes—

Returns

void

Generated from the public TypeScript declarations: signatures, props and defaults come from the checked source, descriptions from its JSDoc. No defaults are invented.