Skip to content
Gravity Logo / Docs Gravity home
Browse documentation
Documentation/Gravity Web

Calendar

The Calendar component is a date field component that allows users to enter and edit dates. It leverages the react-day-picker library.

Usage

import { Calendar } from 'components/lib';

function MyComponent({ ...props }) {
  return (
    <Calendar />
  );
}

Props

PropDescriptionRequiredValue
classNamecustom stylingoptionalSCSS or Tailwind
classNamesclasses passed to the day pickeroptionalSCSS or Tailwind
showOutsideDaysshow days outside the current monthoptionalboolean, default: true

Notes

  • The Calendar component uses the DayPicker from react-day-picker.
  • The className prop allows custom styling to be applied.
  • The classNames prop allows for custom classes to be passed to the day picker.
  • The showOutsideDays prop determines whether days outside the current month are shown.
  • The components prop is used to customise the left and right navigation icons.
  • See the Shadcn Calendar docs for more information