0.1.1-alpha.273 • Published 6 months ago

@gemeente-denhaag/datepicker v0.1.1-alpha.273

Weekly downloads
-
License
EUPL-1.2
Repository
github
Last release
6 months ago

Datepicker

Date pickers let users choose a date from a visual calendar.

When to use

Use date and time pickers when you are asking the user for a date.

Simple date input

Use the simple data input if the date can be remembered by the user easily, such as a date of birth, and they don’t need a calendar to anticipate the dates. It consists only of input fields.

Calendar picker

Use the calendar picker when the user needs to know a date’s relationship to other days or when a date could be variable. It allows the user to view and pick dates from a calendar widget or manually type the date in the text field.

Alternatives and related components

None.

Anatomy

The date picker consists of:

  1. Label: describes what the user can do with the control
  2. Date field: a text input field where the user can manually type in the date
  3. Icon: this calendar icon indicates that the calendar menu is available
  4. Calendar: menu where a date can be selected
  5. Month and year controls: allows the user to navigate through past and future time frames
  6. Previous and next month controls: allows the user to move forward or backward one month at a time
  7. Weekday: days in the week
  8. Day: days in the month

Notes

The documentation of the date field can be found at the component text field.

(Interactive) states

The date picker contains the states inactive, active, hover, disabled and focus.

Design properties

Typography

  • Month and year controls: TheSans/md/700
  • Weekdays: TheSans/md/400z
  • Day: TheSans/md/400

Color

  • Calendar: background-color white, border Grey/2
  • Month and year controls: text color Grey/4, background-color white
  • Previous and next month controls: svg color Grey/4
  • Weekday: text color Grey/3
  • Day inactive: text color Grey/4
  • Day active: text color white, background-color Green/3
  • Today: text color Grey/4, background-color Grey/1

Interactive states

Day

  • Hover inactive: text color Green/3
  • Hover active: text color white, background-color Green/4
  • Disabled inactive: text color Grey/2
  • Disabled active: text color white, background-color Grey/2
  • Focus: border color Ocher/5

Today

  • Hover inactive: text color Green/4, background-color Grey/1
  • Hover active: text color white, background-color Green/4
  • Disabled active: text color white, background-color Grey/2
  • Focus: border color Ocher/5

Structure

  • Calendar: height 312px, width 308px, padding-top 0px, padding-left 12px, padding-right 12px, padding-bottom 24px
  • Month and year controls: height 48px, padding-left and padding-right 12px, chevron icon size 20px
  • Previous and next month controls: padding-left and padding-right 20px
  • Weekday: height and width 32px
  • Day: height and width 32px, padding 8px

Accessibility

Some users might find interacting with date pickers to be challenging. When you use the date picker component, always give users the option to enter the date using a text field component as well.

Keyboard support

Press the tab key to move forward and shift + tab to move backward through the chevron icons, and the calendar

When focus is in the calendar, move keyboard focus between the dates using the arrow keys

To select a date that has focus, press the enter key

Content guidelines

Date format

  • The date format can be displayed differently depending on your location. For example, some countries use month/day/year while other use day/month/year.
  • When using a simple date input include the date format in parentheses inline with the label or as helper text below the label.
  • When using calendar picker the date format will be automated if the user selects from the calendar menu.
  • Only including the date format as placeholder text inside the field is problematic because it will disappear from view once the user begins typing. Also show the date format in the help text.

Best practices

Dos

Date pickers must:

  • Use smart defaults and highlight common selections
  • Used when the user needs to know a date’s relationship to other days or when a date could be variable
  • Close after a single date is selected
  • Follow date format guidelines
  • Always remain a fixed width and is not adjustable. It should always be aligned to the left edge of its assigned text field.
  • Allow users to navigate through months and years, however they work best when used for recent or near future dates.
  • Indicate the current date
  • Add inline errors while in-focus and out-of-focus

Don’ts

Date pickers must:

  • Not be used to enter a date that is many years in the future or the past
  • Not use auto-corrections

Behaviors

Opening the calendar

The calendar can be opened in two ways:

  • Clicking the calendar icon on the far right of the field opens the calendar menu.
  • When the text field receives focus the calendar menu also appears and remains open until a date is selected or the focus is removed from the picker.

Selecting a date

A date can be selected by:

  • Manually entering a date in the text input field.
  • Clicking on a date in the calendar menu.
  • Navigating to a date by using the Arrow keys and then pressing Enter.

Next and previous month

A user can navigate between the months in a year by:

  • Clicking on chevron icons at the top left and right of the calendar.
  • Using the Arrow keys to move through the next or previous month.

Selecting a year

By default the current date and year appears in the calendar. To navigate to another year the user can do one of the following:

  • Manually typing the year in the date text field.

Closing the calendar

The calendar can be closed in one of the following ways:

  • Selecting a single date. This will automatically close it.
  • Clicking anywhere outside of the calendar menu.
  • Removing focus from the picker.
  • Pressing Esc.

Min and max dates

In order to constrain the possible selectable dates in a calendar, a min and max date may be set. Once set, only the dates that fall within the min/max range will be selectable with the dates outside of the range being disabled.

Use min and max dates to help prevent user error. If a user cannot select dates in the past when scheduling, then set a min date to today.

References

https://carbondesignsystem.com/components/date-picker/usage https://uxplanet.org/date-picker-design-best-practices-41bd522f10a5 https://www.nicoleedens.com/research/datepickerbestpractices2020

0.1.1-alpha.262

8 months ago

0.1.1-alpha.261

8 months ago

0.1.1-alpha.260

8 months ago

0.1.1-alpha.269

7 months ago

0.1.1-alpha.268

7 months ago

0.1.1-alpha.267

7 months ago

0.1.1-alpha.266

7 months ago

0.1.1-alpha.265

7 months ago

0.1.1-alpha.264

8 months ago

0.1.1-alpha.263

8 months ago

0.1.1-alpha.273

6 months ago

0.1.1-alpha.272

6 months ago

0.1.1-alpha.271

6 months ago

0.1.1-alpha.270

6 months ago

0.1.1-alpha.240

10 months ago

0.1.1-alpha.248

8 months ago

0.1.1-alpha.247

8 months ago

0.1.1-alpha.246

8 months ago

0.1.1-alpha.245

8 months ago

0.1.1-alpha.244

8 months ago

0.1.1-alpha.243

8 months ago

0.1.1-alpha.242

9 months ago

0.1.1-alpha.241

10 months ago

0.1.1-alpha.249

8 months ago

0.1.1-alpha.251

8 months ago

0.1.1-alpha.250

8 months ago

0.1.1-alpha.259

8 months ago

0.1.1-alpha.258

8 months ago

0.1.1-alpha.257

8 months ago

0.1.1-alpha.256

8 months ago

0.1.1-alpha.255

8 months ago

0.1.1-alpha.254

8 months ago

0.1.1-alpha.253

8 months ago

0.1.1-alpha.252

8 months ago

0.1.1-alpha.239

10 months ago

0.1.1-alpha.238

10 months ago

0.1.1-alpha.237

11 months ago

0.1.1-alpha.236

11 months ago

0.1.1-alpha.226

1 year ago

0.1.1-alpha.225

1 year ago

0.1.1-alpha.224

1 year ago

0.1.1-alpha.223

1 year ago

0.1.1-alpha.222

1 year ago

0.1.1-alpha.229

1 year ago

0.1.1-alpha.228

1 year ago

0.1.1-alpha.227

1 year ago

0.1.1-alpha.235

12 months ago

0.1.1-alpha.234

12 months ago

0.1.1-alpha.233

1 year ago

0.1.1-alpha.232

1 year ago

0.1.1-alpha.231

1 year ago

0.1.1-alpha.230

1 year ago

0.1.1-alpha.221

1 year ago

0.1.1-alpha.220

1 year ago

0.1.1-alpha.215

2 years ago

0.1.1-alpha.214

2 years ago

0.1.1-alpha.213

2 years ago

0.1.1-alpha.219

1 year ago

0.1.1-alpha.218

1 year ago

0.1.1-alpha.217

1 year ago

0.1.1-alpha.216

1 year ago

0.1.1-alpha.209

2 years ago

0.1.1-alpha.208

2 years ago

0.1.1-alpha.207

2 years ago

0.1.1-alpha.206

2 years ago

0.1.1-alpha.212

2 years ago

0.1.1-alpha.210

2 years ago

0.1.1-alpha.185

2 years ago

0.1.1-alpha.184

2 years ago

0.1.1-alpha.183

2 years ago

0.1.1-alpha.182

2 years ago

0.1.1-alpha.181

2 years ago

0.1.1-alpha.180

2 years ago

0.1.1-alpha.189

2 years ago

0.1.1-alpha.188

2 years ago

0.1.1-alpha.187

2 years ago

0.1.1-alpha.186

2 years ago

0.1.1-alpha.196

2 years ago

0.1.1-alpha.195

2 years ago

0.1.1-alpha.194

2 years ago

0.1.1-alpha.193

2 years ago

0.1.1-alpha.192

2 years ago

0.1.1-alpha.191

2 years ago

0.1.1-alpha.190

2 years ago

0.1.1-alpha.199

2 years ago

0.1.1-alpha.198

2 years ago

0.1.1-alpha.197

2 years ago

0.1.1-alpha.179

2 years ago

0.1.1-alpha.178

2 years ago

0.1.1-alpha.204

2 years ago

0.1.1-alpha.203

2 years ago

0.1.1-alpha.202

2 years ago

0.1.1-alpha.201

2 years ago

0.1.1-alpha.200

2 years ago

0.1.1-alpha.205

2 years ago

0.1.1-alpha.141

2 years ago

0.1.1-alpha.140

2 years ago

0.1.1-alpha.149

2 years ago

0.1.1-alpha.148

2 years ago

0.1.1-alpha.147

2 years ago

0.1.1-alpha.146

2 years ago

0.1.1-alpha.145

2 years ago

0.1.1-alpha.144

2 years ago

0.1.1-alpha.143

2 years ago

0.1.1-alpha.142

2 years ago

0.1.1-alpha.152

2 years ago

0.1.1-alpha.151

2 years ago

0.1.1-alpha.150

2 years ago

0.1.1-alpha.159

2 years ago

0.1.1-alpha.158

2 years ago

0.1.1-alpha.157

2 years ago

0.1.1-alpha.156

2 years ago

0.1.1-alpha.155

2 years ago

0.1.1-alpha.154

2 years ago

0.1.1-alpha.153

2 years ago

0.1.1-alpha.127

2 years ago

0.1.1-alpha.126

2 years ago

0.1.1-alpha.129

2 years ago

0.1.1-alpha.128

2 years ago

0.1.1-alpha.130

2 years ago

0.1.1-alpha.138

2 years ago

0.1.1-alpha.137

2 years ago

0.1.1-alpha.136

2 years ago

0.1.1-alpha.135

2 years ago

0.1.1-alpha.134

2 years ago

0.1.1-alpha.133

2 years ago

0.1.1-alpha.132

2 years ago

0.1.1-alpha.131

2 years ago

0.1.1-alpha.139

2 years ago

0.1.1-alpha.163

2 years ago

0.1.1-alpha.162

2 years ago

0.1.1-alpha.161

2 years ago

0.1.1-alpha.160

2 years ago

0.1.1-alpha.169

2 years ago

0.1.1-alpha.168

2 years ago

0.1.1-alpha.167

2 years ago

0.1.1-alpha.166

2 years ago

0.1.1-alpha.165

2 years ago

0.1.1-alpha.164

2 years ago

0.1.1-alpha.174

2 years ago

0.1.1-alpha.173

2 years ago

0.1.1-alpha.172

2 years ago

0.1.1-alpha.171

2 years ago

0.1.1-alpha.170

2 years ago

0.1.1-alpha.177

2 years ago

0.1.1-alpha.176

2 years ago

0.1.1-alpha.175

2 years ago

0.1.1-alpha.125

2 years ago

0.1.1-alpha.124

2 years ago

0.1.1-alpha.123

2 years ago

0.1.1-alpha.122

2 years ago

0.1.1-alpha.121

2 years ago

0.1.1-alpha.120

2 years ago

0.1.1-alpha.116

2 years ago

0.1.1-alpha.115

2 years ago

0.1.1-alpha.114

2 years ago

0.1.1-alpha.113

2 years ago

0.1.1-alpha.112

2 years ago

0.1.1-alpha.119

2 years ago

0.1.1-alpha.118

2 years ago

0.1.1-alpha.105

2 years ago

0.1.1-alpha.104

2 years ago

0.1.1-alpha.103

2 years ago

0.1.1-alpha.102

2 years ago

0.1.1-alpha.101

2 years ago

0.1.1-alpha.100

2 years ago

0.1.1-alpha.99

2 years ago

0.1.1-alpha.98

2 years ago

0.1.1-alpha.97

2 years ago

0.1.1-alpha.96

2 years ago

0.1.1-alpha.109

2 years ago

0.1.1-alpha.95

2 years ago

0.1.1-alpha.108

2 years ago

0.1.1-alpha.94

2 years ago

0.1.1-alpha.107

2 years ago

0.1.1-alpha.93

2 years ago

0.1.1-alpha.106

2 years ago

0.1.1-alpha.92

2 years ago

0.1.1-alpha.111

2 years ago

0.1.1-alpha.110

2 years ago

0.1.1-alpha.91

2 years ago

0.1.1-alpha.90

2 years ago

0.1.1-alpha.88

2 years ago

0.1.1-alpha.87

2 years ago

0.1.1-alpha.86

2 years ago

0.1.1-alpha.85

2 years ago

0.1.1-alpha.84

2 years ago

0.1.1-alpha.83

2 years ago

0.1.1-alpha.82

2 years ago

0.1.1-alpha.81

2 years ago

0.1.1-alpha.89

2 years ago

0.1.1-alpha.80

2 years ago

0.1.1-alpha.77

2 years ago

0.1.1-alpha.76

2 years ago

0.1.1-alpha.75

2 years ago

0.1.1-alpha.74

2 years ago

0.1.1-alpha.73

2 years ago

0.1.1-alpha.72

2 years ago

0.1.1-alpha.71

2 years ago

0.1.1-alpha.70

2 years ago

0.1.1-alpha.79

2 years ago

0.1.1-alpha.78

2 years ago

0.1.1-alpha.69

2 years ago

0.1.1-alpha.55

2 years ago

0.1.1-alpha.54

2 years ago

0.1.1-alpha.53

2 years ago

0.1.1-alpha.52

2 years ago

0.1.1-alpha.51

2 years ago

0.1.1-alpha.50

2 years ago

0.1.1-alpha.59

2 years ago

0.1.1-alpha.58

2 years ago

0.1.1-alpha.57

2 years ago

0.1.1-alpha.56

2 years ago

0.1.1-alpha.49

2 years ago

0.1.1-alpha.48

2 years ago

0.1.1-alpha.47

2 years ago

0.1.1-alpha.66

2 years ago

0.1.1-alpha.65

2 years ago

0.1.1-alpha.64

2 years ago

0.1.1-alpha.63

2 years ago

0.1.1-alpha.62

2 years ago

0.1.1-alpha.61

2 years ago

0.1.1-alpha.60

2 years ago

0.1.1-alpha.68

2 years ago

0.1.1-alpha.67

2 years ago

0.1.1-alpha.46

2 years ago

0.1.1-alpha.45

2 years ago

0.1.1-alpha.44

2 years ago

0.1.1-alpha.43

2 years ago

0.1.1-alpha.42

2 years ago

0.1.1-alpha.41

2 years ago

0.1.1-alpha.40

2 years ago

0.1.1-alpha.39

2 years ago

0.1.1-alpha.38

2 years ago

0.1.1-alpha.37

2 years ago

0.1.1-alpha.36

2 years ago

0.1.1-alpha.35

2 years ago

0.1.1-alpha.34

2 years ago

0.1.1-alpha.33

2 years ago

0.1.1-alpha.32

2 years ago

0.1.1-alpha.31

2 years ago

0.1.1-alpha.30

2 years ago

0.1.1-alpha.29

2 years ago

0.1.1-alpha.28

2 years ago

0.1.1-alpha.27

2 years ago

0.1.1-alpha.26

2 years ago

0.1.1-alpha.25

2 years ago

0.1.1-alpha.24

2 years ago

0.1.1-alpha.23

2 years ago

0.1.1-alpha.22

2 years ago

0.1.1-alpha.21

2 years ago

0.1.1-alpha.20

2 years ago

0.1.1-alpha.19

2 years ago

0.1.1-alpha.18

2 years ago

0.1.1-alpha.17

2 years ago

0.1.1-alpha.16

2 years ago

0.1.1-alpha.15

2 years ago

0.1.1-alpha.14

2 years ago

0.1.1-alpha.13

2 years ago

0.1.1-alpha.12

2 years ago

0.1.1-alpha.11

2 years ago

0.1.1-alpha.7

2 years ago

0.1.1-alpha.6

2 years ago

0.1.1-alpha.5

2 years ago

0.1.1-alpha.4

2 years ago

0.1.1-alpha.3

2 years ago

0.1.1-alpha.2

2 years ago

0.1.1-alpha.1

2 years ago

0.1.1-alpha.0

2 years ago