Skip to content

Date picker

Design guidelines

Date pickers allow users to enter a date either through text input, or by choosing a date from the calendar.

HTML
React
Angular
<certara-datepicker mode="date"></certara-datepicker>
import { CertaraDatepicker } from '@certara/certara-ui-react';
<CertaraDatepicker mode="date" />
// In your module (e.g., app.module.ts)
import { CertaraUiAngularModule } from '@certara/certara-ui-angular';
@NgModule({
imports: [CertaraUiAngularModule]
})
// In your template:
<certara-datepicker mode="date"></certara-datepicker>
<certara-datepicker mode="date" variant="link"></certara-datepicker>
import { CertaraDatepicker } from '@certara/certara-ui-react';
<CertaraDatepicker mode="date" variant="link" />
// In your module (e.g., app.module.ts)
import { CertaraUiAngularModule } from '@certara/certara-ui-angular';
@NgModule({
imports: [CertaraUiAngularModule]
})
// In your template:
<certara-datepicker mode="date" variant="link"></certara-datepicker>
HTML
React
Angular
<certara-input type="date" />
import { CertaraInput } from '@certara/certara-ui-react';
<CertaraInput type="date" />
// In your module (e.g., app.module.ts)
import { CertaraUiAngularModule } from '@certara/certara-ui-angular';
@NgModule({
imports: [CertaraUiAngularModule]
})
// In your template:
<certara-input type="date"></certara-input>

Date and time picker for selecting a single date, a range, or a date with a time of day.

ariaLabel

Attributearia-label
Typestring
Defaultundefined
Requiredfalse
DescriptionAccessible label when not inside a form-group

config

Attributeundefined
TypeDatepickerConfig
Default`{
selectMode: ‘range’,
selected: [],
disabled: [],
selectScopeSize: 0,
weekHeader: ‘per-month’,
// No viewRange by default: months are generated on demand, so navigation is
// unbounded unless min / max (or an explicit viewRange clamp) says otherwise.
i18n: {
months: DEFAULT_MONTHS,
weekDays: DEFAULT_WEEK_DAYS,
// Locale-derived so the polyfill segments match what a native date input
// would render. Only the polyfill draws this separator, so platforms on the
// native path are unaffected. An explicit config.i18n.dateSeparator still wins.
dateSeparator: getLocaleDateFormat().separator,
timeSeparator: ':',

}, monthsToShow: 1, showNavigation: true, }| | __Required__ |false` | | Description | Datepicker configuration object (calendar layout, presets, i18n, etc.). |

disabled

Attributedisabled
Typeboolean
Defaultfalse
Requiredfalse
DescriptionDisable the control

endName

Attributeend-name
Typestring
Defaultundefined
Requiredfalse
DescriptionHidden field name for range end (defaults to name.end)

max

Attributemax
Typestring
Defaultundefined
Requiredfalse
DescriptionMaximum allowed value (ISO date or datetime string)

min

Attributemin
Typestring
Defaultundefined
Requiredfalse
DescriptionMinimum allowed value (ISO date or datetime string)

mode

Attributemode
Type"date" | "datetime" | "month" | "range" | "time"
Default'range'
Requiredfalse
DescriptionControl shape: date, month, datetime, or range

name

Attributename
Typestring
Defaultundefined
Requiredfalse
DescriptionForm field name (hidden ISO field; range uses name.start / name.end)

placement

Attributeplacement
Type"bottom-start" | "top-start"
Default'bottom-start'
Requiredfalse
DescriptionPreferred vertical placement for the popover panel

position

Attributeposition
Type"absolute" | "fixed"
Default'absolute'
Requiredfalse
DescriptionCSS positioning strategy for the popover panel

readonly

Attributereadonly
Typeboolean
Defaultfalse
Requiredfalse
DescriptionRead-only segments (indicator still opens popover)

required

Attributerequired
Typeboolean
Defaultfalse
Requiredfalse
DescriptionWhether the field is required

startName

Attributestart-name
Typestring
Defaultundefined
Requiredfalse
DescriptionHidden field name for range start (defaults to name.start)

step

Attributestep
Typenumber
Defaultundefined
Requiredfalse
DescriptionTime step in seconds (900 is 15 minutes). Applies to time mode and to the datetime popover’s time picker.

value

Attributevalue
Typestring
Default''
Requiredfalse
DescriptionCurrent value (ISO). Reflected as the value attribute. date: YYYY-MM-DD

valueFormat

Attributevalue-format
Type"display" | "iso"
Default'display'
Requiredfalse
DescriptionFormat for the trigger / form value

variant

Attributevariant
Type"default" | "link"
Default'default'
Requiredfalse
DescriptionVisual variant of the control
NameDescriptionBubbles
certaraChangeemits when the composed ISO value changes (certara-ui convention)true
certaraDatepickerDateSelectEmits when a date is selected. Use it to react to date selectedtrue
certaraDatepickerDeselectEmits when a date is deselected. Use it to react to date deselectedtrue
certaraDatepickerHighlightemits when a date or more is highlighted as potential select candidatetrue
certaraDatepickerHighlightClearemits when date highlight is cleared after dates deselecttrue
certaraDatepickerPopoverToggleemits when the popover panel opens or closestrue
certaraDatepickerRangeSelectemits when a complete date range is selected use it to react to a complete date range selectedtrue
certaraFormControlErroremits consolidated validation error for certara-form-grouptrue

There are no public methods available for this component

There are no slots available for this component

Single-line text input. Pair with <certara-form-group> for labelling.

accept

Attributeaccept
Typestring
Defaultundefined
Requiredfalse
DescriptionAccepted file types for file inputs (e.g., “.pdf,.doc”).

disabled

Attributedisabled
Typeboolean
Defaultfalse
Requiredfalse
DescriptionPrevents user interaction.

max

Attributemax
Typenumber | string
Defaultundefined
Requiredfalse
DescriptionMaximum value for number/date inputs.

maxlength

Attributemaxlength
Typenumber
Defaultundefined
Requiredfalse
DescriptionMaximum number of characters allowed.

min

Attributemin
Typenumber | string
Defaultundefined
Requiredfalse
DescriptionMinimum value for number/date inputs.

minlength

Attributeminlength
Typenumber
Defaultundefined
Requiredfalse
DescriptionMinimum number of characters required.

name

Attributename
Typestring
Defaultthis.inputId
Requiredfalse
DescriptionForm control name, used for form submission and validation events.

pattern

Attributepattern
Typestring
Defaultundefined
Requiredfalse
DescriptionRegex pattern the value must match.

placeholder

Attributeplaceholder
Typestring
Defaultundefined
Requiredfalse
DescriptionPlaceholder text shown when empty.

readonly

Attributereadonly
Typeboolean
Defaultfalse
Requiredfalse
DescriptionPrevents editing while allowing selection and copy.

required

Attributerequired
Typeboolean
Defaultfalse
Requiredfalse
DescriptionMarks the field as required for form validation.

size

Attributesize
Type"md" | "sm"
Default'md'
Requiredfalse
DescriptionVisual size variant of the input.

step

Attributestep
Typenumber | string
Defaultundefined
Requiredfalse
DescriptionStep increment for number inputs.

type

Attributetype
Type"date" | "datetime-local" | "email" | "file" | "month" | "number" | "password" | "search" | "tel" | "text" | "time" | "url"
Default'text'
Requiredfalse
DescriptionInput type, affects keyboard on mobile and validation.

value

Attributevalue
Typestring
Defaultundefined
Requiredfalse
DescriptionCurrent value of the input.
NameDescriptionBubbles
certaraBlurEmitted when the input loses focus.true
certaraChangeEmitted when value changes from the previous value.true
certaraFocusEmitted when the input gains focus.true
certaraFormControlErrorEmitted when validation state changes. Payload is the error message or empty string when valid.true
certaraInputEmitted on every keystroke.true
NameSignatureDescription
setBlur() => Promise<void>Programmatically blurs the input.
setError(error: string) => Promise<void>Sets a custom error message. This allows consumers to call input.setError('my error message') instead of input.setAttribute('error', 'my error message').
setFocus() => Promise<void>Programmatically focuses the input.
NameDescription
appendContent placed after the input (e.g., buttons, icons).
prependContent placed before the input (e.g., labels, icons).

Date Pickers allow users to enter a date either through text input, or by choosing a date from the calendar.

Used when selecting a single date is needed. This implementation uses the text field component property type “date”.
Used when selecting a preset time period and/or date range is needed.

Date pickers can display past, present, or future dates. They should use sensible defaults based on their context.

  • The start and end dates may be manually entered or edited in the text field.
  • May or may not include a dropdown with preset time periods.
    • If a preset time period is selected, the system displays the corresponding dates in the text input field.
  • The expandable calendar menu includes day, month, and year selections for start and end dates and highlights all dates between them.
  • The calendar closes after an end date is selected.
  • Date pickers are keyboard operable.
  • Always give users the option to enter the date using the text field.
  • For more information, see our accessibility guidelines.
View component in Figma