No Preview

Sorry, but you either have no stories or none are selected somehow.

If the problem persists, check the browser console, or the terminal you've run Storybook from.

The component failed to render properly, likely due to a configuration issue in Storybook. Here are some common causes and how you can address them:

  1. Missing Context/Providers: You can use decorators to supply specific contexts or providers, which are sometimes necessary for components to render correctly. For detailed instructions on using decorators, please visit the Decorators documentation.
  2. Misconfigured Webpack or Vite: Verify that Storybook picks up all necessary settings for loaders, plugins, and other relevant parameters. You can find step-by-step guides for configuring Webpack or Vite with Storybook.
  3. Missing Environment Variables: Your Storybook may require specific environment variables to function as intended. You can set up custom environment variables as outlined in the Environment Variables documentation.

Date label

import "@inera/ids-core/components/date-label/register";

ids-wc-date-label requires either a stringified date object or a manually supplied month, day and year.

NameDescriptionDefaultControl
Date Label
date
Sets the date
Date object
-
dateto
Sets a (to) date
Date object
-
day
Manually set day. Should be combined with month and year.
0
dayto
Manually set (to) day
0
month
Manually set month. Should be combined with year and day.
0
monthlabel
Manually set the month label. This does not replace the month property but should rather be used together when applying date manually.
""
monthto
Manually set (to) month
0
monthtolabel
Manually set the (to) month label
""
srtext
Screen reader text
""
year
Manually set year. Should be combined with month and day.
0
yearto
Manually set (to) year
0

With date

A stringified Date object can be supplied to the date property: date new Date().toString()

Manually set date

It is also possible to select the month, day, and year manually. Note that the properties are handled as numbers.

With two dates

Language support

There is no support for languages in the component itself. You may however set the month text to whichever text you want. Just use the monthlabel.

Note that the monthlabel does NOT replace month. Use them both to ensure screen reader compatibility (like the example below).

Accessibility

Remember to set the srtext.