DatePickerProps
Props of DatePicker: the moment picked, what it picks, and its bounds.
Usage
Choose a future due date
This type is used by DatePicker
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
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
| Name | Type | Required | Description |
|---|---|---|---|
value | number | No | 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. |
type | DatePickerType | No | date by default. A pick keeps the part of the moment its type doesn't show. |
min | number | No | The earliest moment the user can pick, in milliseconds. |
max | number | No | The latest moment the user can pick, in milliseconds. |
disabled | boolean | No | — |
onChange | (value: number) => void | No | The moment the user picked, in milliseconds. |
onChange — method signatures
Signatures
(value: number): voidParameters
| Name | Type | Required | Description |
|---|---|---|---|
value | number | Yes | — |
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.