Leave Yamada UI a star

Star
Yamada UIYamada UIv1.5.0

Calendar

Calendar is a component for displaying or selecting dates in a calendar.

Source@yamada-ui/calendar

Props

CalendarProps

amountOfMonths

Description

The number of months to display.

Type

number

Default

1

colorScheme

Description

The visual color appearance of the component.

Type

"whiteAlpha" | "blackAlpha" | "gray" | "neutral" | "red" | "rose" | "pink" | "flashy" | "orange" | "amber" | "yellow" | "lime" | "green" | "emerald" | "teal" | "cyan" | "sky" | "blue" | "indigo" | "violet" | "purple" | "fuchsia"

Default

primary

controlProps

Description

Props for calendar control button element.

Type

IconButtonProps

dateFormat

Description

The format used for conversion. Check the docs to see the format of possible modifiers you can pass.

Type

string

Default

'MMMM YYYY'

Docs

https://day.js.org/docs/en/display/format#list-of-localized-formats

dayProps

Description

Props for calendar day button element.

Type

Omit<PropsOf<"button">, "ref" | keyof StyleProps> & StyleProps & PseudoProps & { __css?: CSSUIObject | undefined; sx?: CSSUIObject | undefined; css?: Interpolation<...>; } & { ...; } & ThemeProps<...> & ButtonOptions & { ...; }

defaultMonth

Description

The initial month of the calendar.

Type

Date

Default

'new Date()'

defaultType

Description

The initial type of the calendar.

Type

"date" | "month" | "year"

defaultValue

Description

The initial value of the calendar.

Type

NonNullable<Y>

disableOutsideDays

Description

If true, outside days will be disabled.

Type

boolean

Default

false

enableMultiple

Description

If true, enables date multiple selection.

Type

boolean

Default

false

enableRange

Description

If true, enables date range selection.

Type

boolean

Default

false

excludeDate

Description

Callback function to determine whether the day should be disabled.

Type

(date: Date) => boolean

firstDayOfWeek

Description

Define the first day of the week.

Type

"sunday" | "monday"

Default

'monday'

headerProps

Description

Props for calendar header element.

Type

HTMLUIProps<"div">

hiddenOutsideDays

Description

If true, outside days will be hidden.

Type

boolean

holidays

Description

Define holidays.

Type

Date[]

labelProps

Description

Props for calendar label button element.

Type

Omit<PropsOf<"button">, "ref" | keyof StyleProps> & StyleProps & PseudoProps & { __css?: CSSUIObject | undefined; sx?: CSSUIObject | undefined; css?: Interpolation<...>; } & { ...; } & ThemeProps<...> & ButtonOptions & { ...; }

maxDate

Description

The maximum possible date.

Type

Date

maxSelectValues

Description

The maximum selectable value.

Type

number

minDate

Description

The minimum possible date.

Type

Date

month

Description

The month of the calendar.

Type

Date

monthProps

Description

Props for calendar month button element.

Type

Omit<PropsOf<"button">, "ref" | keyof StyleProps> & StyleProps & PseudoProps & { __css?: CSSUIObject | undefined; sx?: CSSUIObject | undefined; css?: Interpolation<...>; } & { ...; } & ThemeProps<...> & ButtonOptions & { ...; }

nextProps

Description

Props for calendar next control button element.

Type

IconButtonProps

nextRef

Description

Ref to a next function.

Type

type ONLY_FOR_FORMAT = | ((instance: (() => void | undefined) | null) => void) | MutableRefObject<(() => void | undefined) | null>

onChange

Description

The callback invoked when value state changes.

Type

(value: Y) => void

onChangeMonth

Description

The callback invoked when month state changes.

Type

(value: Date) => void

onChangeType

Description

The callback invoked when type state changes.

Type

( type: "date" | "month" | "year", year?: number | undefined, month?: number | undefined, ) => void

paginateBy

Description

The number of months to paginate.

Type

number

Default

1

prevProps

Description

Props for calendar previous control button element.

Type

IconButtonProps

prevRef

Description

Ref to a previous function.

Type

type ONLY_FOR_FORMAT = | ((instance: (() => void | undefined) | null) => void) | MutableRefObject<(() => void | undefined) | null>

size

Description

The size of the Calendar.

Type

"sm" | "md" | "lg" | "full"

Default

md

tableProps

Description

Props for calendar month table element.

Type

Omit<PropsOf<"table">, "ref" | keyof StyleProps> & StyleProps & PseudoProps & { __css?: CSSUIObject | undefined; sx?: CSSUIObject | undefined; css?: Interpolation<...>; } & { ...; } & { ...; }

today

Description

If true, highlight today.

Type

boolean

Default

false

type

Description

The type of the calendar.

Type

"date" | "month" | "year"

typeRef

Description

Ref to a type function.

Type

type ONLY_FOR_FORMAT = | ((instance: (() => void | undefined) | null) => void) | MutableRefObject<(() => void | undefined) | null>

value

Description

The value of the calendar.

Type

NonNullable<Y>

variant

Description

The variant of the Calendar.

Type

"solid" | "subtle" | "unstyled"

Default

solid

weekdayProps

Description

Props for calendar weekday element.

Type

Omit<PropsOf<"div">, "ref" | keyof StyleProps> & StyleProps & PseudoProps & { __css?: CSSUIObject | undefined; sx?: CSSUIObject | undefined; css?: Interpolation<...>; } & { ...; } & { ...; }

weekendDays

Description

Define weekend days.

Type

number[]

Default

'[0, 6]'

withControls

Description

If true, display the calendar control buttons.

Type

boolean

Default

true

withHeader

Description

If true, display the calendar header.

Type

boolean

Default

true

withLabel

Description

If true, display the calendar label button.

Type

boolean

Default

true

withWeekdays

Description

If true, display the calendar weekdays.

Type

boolean

Default

true

yearProps

Description

Props for calendar year button element.

Type

Omit<PropsOf<"button">, "ref" | keyof StyleProps> & StyleProps & PseudoProps & { __css?: CSSUIObject | undefined; sx?: CSSUIObject | undefined; css?: Interpolation<...>; } & { ...; } & ThemeProps<...> & ButtonOptions & { ...; }

Edit this page on GitHub

PreviousBarChartNextCard