Skip to content

3lvia/designsystem / skills/elvia-design-system

elvia-design-system

Verified

Reference for UI components and patterns in Elvia's design system ("Elvis"). Covers component- and pattern-specific guidelines for sizing, color tokens for custom UI, types, ordering, labeling, accessibility attributes, CSS setup, and web-component registration. Use when building, reviewing, or fixing UI in an Elvia frontend, even if the request doesn't name Elvia or the CSS classes explicitly (e.g. "add a save button", "make this icon bigger", "add a tooltip").

FileKindSize
README.mdmarkdown726 B
SKILL.mdskill md10.4 KB
references/accordion.mdmarkdown5.9 KB
references/alert.mdmarkdown4.3 KB
references/app-bridge.mdmarkdown3.3 KB
references/autocomplete.mdmarkdown5.5 KB
references/badge.mdmarkdown2.3 KB
references/box.mdmarkdown2.0 KB
references/breadcrumb.mdmarkdown2.9 KB
references/button.mdmarkdown6.0 KB
references/card.mdmarkdown5.6 KB
references/carousel.mdmarkdown4.4 KB
references/checkbox.mdmarkdown4.7 KB
references/chip.mdmarkdown4.1 KB
references/color-tokens.mdmarkdown5.6 KB
references/content-loader.mdmarkdown2.0 KB
references/context-menu.mdmarkdown6.6 KB
references/data-formats.mdmarkdown2.1 KB
references/datepicker-range.mdmarkdown5.4 KB
references/datepicker.mdmarkdown6.0 KB
references/divider.mdmarkdown2.4 KB
references/drag-and-drop.mdmarkdown2.0 KB
references/dropdown.mdmarkdown6.7 KB
references/empty-state.mdmarkdown3.0 KB
references/file-upload.mdmarkdown2.6 KB
references/form-field.mdmarkdown2.7 KB
references/header.mdmarkdown5.8 KB
references/icon.mdmarkdown5.0 KB
references/illustrations.mdmarkdown1.4 KB
references/input.mdmarkdown2.5 KB
references/installation.mdmarkdown2.1 KB
references/link.mdmarkdown3.3 KB
references/list.mdmarkdown2.0 KB
references/modal.mdmarkdown6.1 KB
references/pagination.mdmarkdown4.0 KB
references/popover.mdmarkdown5.3 KB
references/progress-linear.mdmarkdown3.1 KB
references/radio-button.mdmarkdown2.6 KB
references/radio-filter.mdmarkdown2.8 KB
references/search-pattern.mdmarkdown2.7 KB
references/segmented-control.mdmarkdown3.9 KB
references/shadows.mdmarkdown1.3 KB
references/slider.mdmarkdown3.6 KB
references/stepper.mdmarkdown4.7 KB
references/table.mdmarkdown8.4 KB
references/tabs.mdmarkdown3.8 KB
references/tag.mdmarkdown5.0 KB
references/thumbnail.mdmarkdown1.9 KB
references/timepicker.mdmarkdown5.1 KB
references/toast.mdmarkdown3.4 KB
references/toggle.mdmarkdown2.1 KB
references/tooltip.mdmarkdown4.1 KB
references/typography.mdmarkdown3.3 KB
references/utility-classes.mdmarkdown3.9 KB
references/web-components.mdmarkdown2.1 KB

references/datepicker-range.md

View on GitHub
- [Datepicker range (`<elvia-datepicker-range>`)](#datepicker-range-elvia-datepicker-range)
  - [Reference](#reference)
  - [Installation](#installation)
  - [Use](#use)
  - [Attributes](#attributes)
    - [value](#value)
    - [labelOptions](#labeloptions)
    - [isRequired](#isrequired)
    - [isVertical](#isvertical)
    - [hasTimepickers](#hastimepickers)
    - [hasSelectDateOnOpen](#hasselectdateonopen)
    - [hasAutoOpenEndDatepicker](#hasautoopenenddatepicker)
    - [minDate and maxDate](#mindate-and-maxdate)
    - [disableDates](#disabledates)
    - [errorOptions](#erroroptions)
  - [Guidelines](#guidelines)
    - [When to use](#when-to-use)
    - [When not to use](#when-not-to-use)
  - [Accessibility](#accessibility)
  - [Examples](#examples)

# Datepicker range (`<elvia-datepicker-range>`)

## Reference

https://design.elvia.io/components/datepicker-range

`<elvia-datepicker-range>` is a web component.

## Installation

This web component requires the `@elvia/elvis-datepicker-range` package. See the
[Installation reference](./installation.md).

## Use

```html
<elvia-datepicker-range></elvia-datepicker-range>
```

See [Web components](./web-components.md) for attributes, properties, and events.

## Attributes

### value

Set an object with `start` and `end` as `Date` or `null`.

The `valueOnChange` event returns `{ start, end }` as `Date`, `null` for an empty field, or `Invalid Date`.
The `valueOnChangeISOString` event returns `{ start, end }`, each containing a `YYYY-MM-DD` string without
time, `null` for an empty field, or the string `'Invalid Date'` for invalid input.

```js
const range = document.querySelector('elvia-datepicker-range');
range.value = { start: new Date(2026, 9, 1), end: new Date(2026, 9, 31) };
```

### labelOptions

Set an object with `start` and `end` strings. The defaults are `Fra dato` and `Til dato`.

```js
range.labelOptions = { start: 'Oppstart', end: 'Avslutning' };
```

### isRequired

Set to `true` to require both dates. Set an object to require only one date.

```js
range.isRequired = { start: true, end: false };
```

### isVertical

The default is `false`. Set to `true` to stack the two pickers. Use it for narrow screens.

```html
<elvia-datepicker-range isVertical></elvia-datepicker-range>
```

### hasTimepickers

The default is `false`. Set to `true` to show a [Timepicker](./timepicker.md) for each date. Set
`timepickerInterval` to change the minute step. The default is `15`.

```html
<elvia-datepicker-range hasTimepickers timepickerInterval="10"></elvia-datepicker-range>
```

### hasSelectDateOnOpen

The default is `true`. An empty start picker selects `minDate` when set; otherwise it selects today or an
earlier selected end date. An empty end picker selects `maxDate` when set; otherwise it selects today or a
later selected start date. Set to `false` to keep empty pickers empty until the user selects a date.

```html
<elvia-datepicker-range hasSelectDateOnOpen="false"></elvia-datepicker-range>
```

### hasAutoOpenEndDatepicker

The default is `false`. Set to `true` to open the next picker when a picker closes.

The next picker opens only if the user changed the start value, or if the start or end value was empty. If the
user closes the start picker without a change, the end picker does not open.

The sequence is start date, end date. With `hasTimepickers`, the sequence is start date, start time, end date,
end time. The sequence stops after the last picker.

```html
<elvia-datepicker-range hasAutoOpenEndDatepicker></elvia-datepicker-range>
```

### minDate and maxDate

Set a `Date` for the first and last available day. The limits apply to both pickers.

```js
range.minDate = new Date(2026, 9, 1);
range.maxDate = new Date(2026, 9, 31);
```

### disableDates

Set an object with `start` and `end` functions. Each function accepts a `Date`. Return `true` to disable the
date.

This function does not validate typed dates. It does not prevent automatic selection when a picker opens.
Validate these dates in the application.

```js
const isWeekend = (day) => day.getDay() === 0 || day.getDay() === 6;
range.disableDates = { start: isWeekend, end: isWeekend };
```

### errorOptions

Set an object with `start` and `end`. Each one accepts `text`, `hideText`, `isErrorState`, and
`hasErrorPlaceholder`. The defaults are the same as for the [Datepicker](./datepicker.md#erroroptions).

The `errorOnChange` event returns `{ start, end }` with internal validation messages. It does not report
custom errors.

```js
range.errorOptions = { end: { text: 'Velg en senere dato' } };
```

## Guidelines

### When to use

- Use Datepicker range when the end date must not be before the start date. The component moves the other date
  to match when the user selects an invalid order.

### When not to use

- Use [Datepicker](./datepicker.md) for one date.

## Accessibility

- Keep the `labelOptions` values nonempty. Each input needs an accessible name.
- The component changes its `aria-label` values with the `lang` attribute on the `html` element.

## Examples

**Input:** Select a period in October 2026. Both dates are required.

**Output:**

```html
<elvia-datepicker-range id="period" isRequired="true" hasSelectDateOnOpen="false"></elvia-datepicker-range>
```

```js
const period = document.querySelector('#period');
period.minDate = new Date(2026, 9, 1);
period.maxDate = new Date(2026, 9, 31);
period.addEventListener('valueOnChangeISOString', (event) => {
  const { start, end } = event.detail.value;
  console.log(start, end);
});
```
brainstormingobra/superpowersYou MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or planning anything new, in software or out of it (a talk, a business, a renovation).Stars: 322kUpdated Claude CodeCodexVerifiedInstall
brand-guidelinesanthropics/skillsApplies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand colors or style guidelines, visual formatting, or company design standards apply.Stars: 198kUpdated Claude CodeCodexVerifiedInstall
frontend-designanthropics/skillsGuidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making choices that don't read as templated defaults.Stars: 198kUpdated Claude CodeCodexVerifiedInstall
mcp-builderanthropics/skillsGuide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK).Stars: 198kUpdated Claude CodeCodexVerifiedInstall