An abstraction of the text-input component which incorporates a calendar. This is for when you need the user to pick a date, but in a fixed, predictable format. In a perfect world, we'd just use the standard HTML5 date field, but at the moment it's not well supported across browsers.
See the calendar component for more information on how it works.
Standard date input component, with an inline calender which pushes down subsequent elements when active.
Mon | Tue | Wed | Thu | Fri | Sat | Sun |
---|
The input calendar comes with extra fields to specify a time.
Mon | Tue | Wed | Thu | Fri | Sat | Sun |
---|
A list of modifiers for the date input component, allowing you to change its appearance to fit a variety of roles and scenarios.
Modifiers can typically be combined to achieve the desired appearance, unless stated otherwise.
The c-input__calendar--float
modifier placed on c-input__calendar
, makes the calendar absolute positioned, so stops it from interferring with any other content when active. Beware of using this on smaller screens as the calendar widget may stray off the page and become inaccessible to the user.
Mon | Tue | Wed | Thu | Fri | Sat | Sun |
---|
Makes the calendar appear above the input, as long as the c-input__calendar
is placed before the c-input__wrapper
element. All other modifiers should work in conjunction with this.
Mon | Tue | Wed | Thu | Fri | Sat | Sun |
---|
Adding this modifier makes the calendar breakout of its parent container ever so slightly. This is for when the designs requires the input to have a small width, but it's too small a width for the calendar to display properly.
The modifier exists purely as responsive classes based on framework breakpoints (c-input__calendar--breakout@sm
, c-input__calendar--breakout@md
etc) as you'll never want this behavour on smaller screens.
Mon | Tue | Wed | Thu | Fri | Sat | Sun |
---|
You can modify the date input component by overriding certain JavaScript functionality through HTML data-attributes.
You can modify date input component functionality by adding the below data attribute. Unless stated otherwise, these must be placed on the top level block component (eg:- c-calendar
)
Name | ||||||||
---|---|---|---|---|---|---|---|---|
Name |
data-date-input-format
|
|||||||
Description | ||||||||
Description |
Enter a date format which you wish the selected date to be shown in. Any user freetyped dates will also be validated against this format. See Moment.js docs for date format examples. |
|||||||
Default | ||||||||
Example | ||||||||
Example |
|
You can theme the date input component to make it fit your brand. For more information on theming EvoToolkit, please see Configuring EvoToolkit.
Below is a list of theme variables and their default values.
Theme Variables | Default |
---|---|
$component-input-focus-color |
primary |
$component-input-border-color |
light |
$component-input-disabled-background-color |
very-light |
$component-input-box-color |
very-light |
$component-input-disabled-text-color |
light |
$component-input-calendar-box-border-color |
primary |