docs/developer_docs/components/ui/datepicker.mdx
import { StoryWithControls } from '../../../src/components/StorybookWrapper';
The DatePicker component from Superset's UI library.
<StoryWithControls component="DatePicker" props={{ placeholder: "Select date", showNow: true, allowClear: false, autoFocus: true, disabled: false, format: "YYYY-MM-DD hh:mm a", inputReadOnly: false, picker: "date", placement: "bottomLeft", size: "middle", showTime: { format: "hh:mm a", needConfirm: false } }} controls={[ { name: "placeholder", label: "Placeholder", type: "text" }, { name: "showNow", label: "Show Now", type: "boolean", description: "Show "Now" button to select current date and time." } ]} />
Edit the code below to experiment with the component:
function Demo() {
return (
<DatePicker
placeholder="Select date"
format="YYYY-MM-DD hh:mm a"
showNow
showTime={{ format: 'hh:mm a', needConfirm: false }}
/>
);
}
| Prop | Type | Default | Description |
|---|---|---|---|
placeholder | string | "Select date" | - |
showNow | boolean | true | Show "Now" button to select current date and time. |
allowClear | boolean | false | - |
autoFocus | boolean | true | - |
disabled | boolean | false | - |
format | string | "YYYY-MM-DD hh:mm a" | - |
inputReadOnly | boolean | false | - |
picker | string | "date" | - |
placement | string | "bottomLeft" | - |
size | string | "middle" | - |
showTime | any | {"format":"hh:mm a","needConfirm":false} | - |
import { DatePicker } from '@superset/components';
:::tip[Improve this page] This documentation is auto-generated from the component's Storybook story. Help improve it by editing the story file. :::