4.65.5 • Published 10 days ago

@contentful/f36-datepicker v4.65.5

Weekly downloads
-
License
MIT
Repository
github
Last release
10 days ago

title: 'Datepicker' status: 'stable' isNew: true slug: /components/datepicker/ github: 'https://github.com/contentful/forma-36/tree/main/packages/components/datepicker' storybook: 'https://f36-storybook.contentful.com/?path=/story/components-datepicker' typescript: ./src/Datepicker.tsx

section: 'dateComponents'

Datepicker component enables users to enter a date either through text input or selecting a date from the Calendar dropdown.

The Datepicker component combines text input, and calendar in dropdown.

Use Datepicker to ask user's for date input in forms, modals, or filtering.

Import

import { Datepicker } from '@contentful/f36-components';
// or
import { Datepicker } from '@contentful/f36-datepicker';

Examples

Basic

Display Datepicker component with text input

Date Formats

Datepicker supports printing out different formats to users, see https://date-fns.org/v2.16.1/docs/format

At Contentful we use dd LLL yyyy format to communicate date to users, example 31 Jan 2021

Visual States

Visual states indicates to users certain messages through UI.

Communicate to the users in text why the Datepicker is in a specific state, example:

Disabled: "You don't have access to edit this field!" Invalid: "Please enter a valid date!"

Wrapped in FormControl

You can use Datepicker with the FormControl in order to enhance layout with input label, help text or validation message.

Limiting the date range

Set mininum and/or maximum dates to limit users to choose from a specific period in time.

Use the fromDate and toDate properties to control time frames.

Multiple months

If you need to show more than a month at once, use the numberOfMonths property.

Open by default

Use the defaultIsOpen property to open the dropdown and display the Calendar by default without user interaction.

Note: the Calendar closes by pressing the escape key or by clicking outside of the Datepicker.

Custom

If you need a custom solution, you can build it by leveraging our lower-level components, such as Calendar, Popover, and TextInput. For example, Datepicker that uses text input as a trigger without a button.

Props (API reference)

Accessibility

  • Keyboard navigation is supported
  • Necessary aria roles are provided by default
  • When providing a label, ensure it's linked to the text input
4.65.5

10 days ago

4.65.4

12 days ago

4.65.3

13 days ago

4.65.2

13 days ago

4.65.1

16 days ago

4.65.0

19 days ago

4.63.0

1 month ago

4.64.0

1 month ago

4.62.0

1 month ago

4.61.0

2 months ago

4.60.3

2 months ago

4.60.2

3 months ago

4.60.1

3 months ago

4.60.0

3 months ago

4.59.3

3 months ago

4.59.2

3 months ago

4.59.1

3 months ago

4.59.0

3 months ago

4.58.4

4 months ago

4.58.3

4 months ago

4.58.2

4 months ago

4.58.1

4 months ago

4.58.0

4 months ago

4.57.0

4 months ago

4.56.1

5 months ago

4.56.2

5 months ago

4.56.0

5 months ago

4.55.1

5 months ago

4.55.0

5 months ago

4.54.5

5 months ago

4.54.4

5 months ago

4.49.1

9 months ago

4.49.0

9 months ago

4.52.1

8 months ago

4.52.2

7 months ago

4.52.0

8 months ago

4.52.3

7 months ago

4.47.0

10 months ago

4.48.2

9 months ago

4.48.1

9 months ago

4.48.0

10 months ago

4.51.0

8 months ago

4.54.0

6 months ago

4.54.3

6 months ago

4.54.1

6 months ago

4.54.2

6 months ago

4.53.0

7 months ago

4.46.0

10 months ago

4.47.3

10 months ago

4.47.2

10 months ago

4.47.1

10 months ago

4.50.0

9 months ago

4.50.1

8 months ago

4.50.2

8 months ago

4.45.0

11 months ago

4.44.0

11 months ago

4.37.1

1 year ago

4.37.0

1 year ago

4.40.3

12 months ago

4.40.2

12 months ago

4.40.1

12 months ago

4.40.0

12 months ago

4.40.7

12 months ago

4.40.6

12 months ago

4.40.5

12 months ago

4.40.4

12 months ago

4.43.0

11 months ago

4.36.0

1 year ago

4.39.0

1 year ago

4.42.0

11 months ago

4.38.1

1 year ago

4.38.0

1 year ago

4.41.1

12 months ago

4.41.0

12 months ago

4.35.0

1 year ago

4.33.0

1 year ago

4.29.0

1 year ago

4.32.0

1 year ago

4.31.0

1 year ago

4.30.2

1 year ago

4.30.1

1 year ago

4.30.0

1 year ago

4.34.1

1 year ago

4.34.0

1 year ago

4.30.3

1 year ago

4.28.0

1 year ago

4.27.0

1 year ago

4.25.0

1 year ago

4.26.0

1 year ago

4.24.1

1 year ago

4.25.1

1 year ago

4.25.2

1 year ago

4.21.4

2 years ago

4.24.0

1 year ago

4.21.5

2 years ago

4.21.6

1 year ago

4.21.7

1 year ago

4.21.8

1 year ago

4.23.0

1 year ago

4.23.1

1 year ago

4.23.2

1 year ago

4.22.0

1 year ago

4.23.3

1 year ago

4.21.1

2 years ago

4.21.2

2 years ago

4.21.3

2 years ago

4.21.0

2 years ago

5.0.0

2 years ago

4.20.9

2 years ago

4.20.2

2 years ago

4.20.3

2 years ago

4.20.4

2 years ago

4.20.5

2 years ago

4.20.1

2 years ago

4.20.6

2 years ago

4.20.7

2 years ago

4.20.8

2 years ago

4.2.2

2 years ago

4.2.1

2 years ago

4.2.0

2 years ago

4.1.0-beta.8

2 years ago

4.1.0-beta.7

2 years ago

5.0.0-beta.1

2 years ago

4.1.0-beta.0

2 years ago

4.1.0-beta.1

2 years ago

4.1.0-beta.6

2 years ago

4.1.0-beta.4

2 years ago

4.1.0-beta.5

2 years ago

4.1.0-beta.2

2 years ago

4.1.0-beta.3

2 years ago

4.1.0

2 years ago