Leave Yamada UI a star

Star
Yamada UIYamada UIv1.6.4

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

"blackAlpha" | "whiteAlpha" | "amber" | "blue" | "info" | "link" | "primary" | "cyan" | "emerald" | "flashy" | "fuchsia" | "gray" | "green" | "success" | "indigo" | "lime" | "neutral" | "orange" | "warning" | "pink" | "purple" | "red" | "danger" | "rose" | "sky" | "teal" | "violet" | "secondary" | "yellow"

Default

"primary"

controlProps

Description

Props for calendar control button element.

Type

Omit<CalendarControlProps, "operation">

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

{ component?: FC<DayProps> | undefined } & ButtonProps

defaultMonth

Description

The initial month of the calendar.

Type

Date

Default

'new Date()'

defaultType

Description

The initial type of the calendar.

Type

"month" | "date" | "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

"monday" | "sunday"

Default

'monday'

headerProps

Description

Props for calendar header element.

Type

HTMLUIProps

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

{ icon?: | IconProps | ReactElement<any, string | JSXElementConstructor<any>> | undefined } & CalendarLabelProps

maxDate

Description

The maximum possible date.

Type

Date

maxSelectValues

Description

The maximum selectable value.

Type

number

minDate

Description

The minimum possible date.

Type

Date

minSelectValues

Description

The minimum selectable value.

Type

number

month

Description

The month of the calendar.

Type

Date

monthGridProps

Description

Props for calendar month grid element.

Type

HTMLUIProps

monthProps

Description

Props for calendar month button element.

Type

{ component?: FC<{ index: number; month: string; year: number }> | undefined } & ButtonProps

nextProps

Description

Props for calendar next control button element.

Type

Omit<CalendarControlProps, "operation">

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: "month" | "date" | "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

Omit<CalendarControlProps, "operation">

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

MonthTableProps

today

Description

If true, highlight today.

Type

boolean

Default

false

type

Description

The type of the calendar.

Type

"month" | "date" | "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

{ component?: FC<WeekdayProps> | undefined } & UIProps & Omit<HTMLProps<"div">, keyof UIProps>

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

yearGridProps

Description

Props for calendar year grid element.

Type

HTMLUIProps

yearProps

Description

Props for calendar year button element.

Type

{ component?: FC<{ index: number; year: number }> | undefined } & ButtonProps

Edit this page on GitHub

PreviousNativeTableNextLineChart