Components
Datepicker

Datepicker

Import

import { VKDatepicker } from "@vivakits/react-components";

Title

A date picker component with range and presets.

Limit Date range

Limit the range of available dates by using minDate and maxDate.

Date Format

We can set the date format by format. refer to dayjs#format

Multiple Date Selection

Multiple selections. Allowing for multiple date selections.

Icon

Custom prefix and suffixIcon.

Import

import { VKRangePicker } from "@vivakits/react-components";

Basic Date Range Picker

A simple date picker component that has a range

Disabled Specific Dates

Use disabledDates to make a particular date disable.

Limit Date range

Use minDate and maxDate to restrict the range of available dates.

API Reference

AttributeTypeDescriptionDefault
valuedate | date[] | nullTo set date-
onChangefunction({ date: Date | Date[], dateString: string })Callback function, can be executed when the selected date is changing-
minDatedateThe minimum date -
maxDatedateThe maximum date -
formatstringTo set the date format, support multi-format matching when it is an array, display the first one shall prevail. refer to dayjs#format (opens in a new tab). for example: Custom FormatDD-MM-YYYY
multiplebooleanEnable multiple date selection false
iconReactNodeSet Calendar Icon-
iconPositionstart endIcon Positionstart
placeholderstringThe placeholder of date input-
colorprimarysecondarysuccessdangerwarningdarklight Optional. Theme color of the date picker. -
roundeddefaultnonexssmmdlgfull Optional. Border radius of the date picker. -
sizesmmdlgxl Optional. Size of the date picker. -
variantsolidoutline Optional -

Date Range API Reference

AttributeTypeDescriptionDefault
startDatedate | nullTo set start date-
endDatedate | nullTo set end date-
onChangefunction({ startDate: Date | null, endDate: Date | null })Callback function, can be executed when the selected date range is changing-
disabledDatesdate[]To disable certain dates -
minDatedateThe minimum date -
maxDatedateThe maximum date -
formatstringTo set the date format, support multi-format matching when it is an array, display the first one shall prevail. refer to dayjs#format (opens in a new tab). for example: Custom FormatDD-MM-YYYY
iconReactNodeSet Calendar Icon-
iconPositionstart endIcon Positionstart
placeholderstringThe placeholder of date input-
colorprimarysecondarysuccessdangerwarningdarklight Optional. Theme color of the date picker. -
roundeddefaultnonexssmmdlgfull Optional. Border radius of the date picker. -
sizesmmdlgxl Optional. Size of the date picker. -
variantsolidoutline Optional -