# Date Picker Date Picker component allows users to select a single date or a range of dates using a calendar interface. It ensures accurate and consistent date selection across workflows. **Category:** Components **Storybook:** https://doc.ux4g.gov.in/web/?path=/story/ux4g-components-date-picker--introduction ## Variants documented in Storybook - Single Date Picker: https://doc.ux4g.gov.in/web/?path=/story/ux4g-components-date-picker--single-date-picker - Date Range Picker: https://doc.ux4g.gov.in/web/?path=/story/ux4g-components-date-picker--date-range-picker - Time Picker: https://doc.ux4g.gov.in/web/?path=/story/ux4g-components-date-picker--time-picker ## Framework setup ### HTML / CDN ```html ``` ### React ```bash npm install ux4g-web-components ``` ```jsx import 'ux4g-web-components/styles.css'; import 'ux4g-web-components/design-system'; ``` ### Angular Update `angular.json`: ```json { "styles": [ "node_modules/ux4g-web-components/styles/ux4g.css", "src/styles.css" ], "scripts": [ "node_modules/ux4g-web-components/dist/runtime/design-system.js" ] } ``` ## Code examples The snippets below are extracted from the Storybook canvas for Date Picker. Each example shows the rendered HTML, the equivalent React JSX, and the Angular template markup. ### 1. Date Range Picker — Date Range Picker HTML: ```html
Date Picker component allows users to select a single date or a range of dates using a calendar interface. It ensures accurate and consistent date selection across workflows.
Visual demonstration of Date Picker variations.
Quickly copy layout and utility classes for Date Pickers.
|
Date Picker Container
ux4g-date-picker-container
|
|
Date Range Container
ux4g-date-range-picker
|
|
Dropdown Menu
ux4g-date-picker-dropdown
|
|
Calendar Grid Container
ux4g-date-picker-calendar
|
|
Time Picker Container
ux4g-time-picker-container
|
|
Muted Day (Out of Month)
is-muted
|
|
Current Day Highlight
is-today
|
|
Range Selection Start
is-range-start
|
|
Within Selection Range
is-in-range
|
|
Range Selection End
is-range-end
|
Date Picker component allows users to select a single date or a range of dates using a calendar interface. It ensures accurate and consistent date selection across workflows.
Visual demonstration of Date Picker variations.
Quickly copy layout and utility classes for Date Pickers.
|
Date Picker Container
ux4g-date-picker-container
|
|
Date Range Container
ux4g-date-range-picker
|
|
Dropdown Menu
ux4g-date-picker-dropdown
|
|
Calendar Grid Container
ux4g-date-picker-calendar
|
|
Time Picker Container
ux4g-time-picker-container
|
|
Muted Day (Out of Month)
is-muted
|
|
Current Day Highlight
is-today
|
|
Range Selection Start
is-range-start
|
|
Within Selection Range
is-in-range
|
|
Range Selection End
is-range-end
|
Date Picker component allows users to select a single date or a range of dates using a calendar interface. It ensures accurate and consistent date selection across workflows.
Visual demonstration of Date Picker variations.
Quickly copy layout and utility classes for Date Pickers.
|
Date Picker Container
ux4g-date-picker-container
|
|
Date Range Container
ux4g-date-range-picker
|
|
Dropdown Menu
ux4g-date-picker-dropdown
|
|
Calendar Grid Container
ux4g-date-picker-calendar
|
|
Time Picker Container
ux4g-time-picker-container
|
|
Muted Day (Out of Month)
is-muted
|
|
Current Day Highlight
is-today
|
|
Range Selection Start
is-range-start
|
|
Within Selection Range
is-in-range
|
|
Range Selection End
is-range-end
|