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.

Textarea

import "@inera/ids-core/components/form/textarea/register"; // optional import "@inera/ids-core/components/form/error-message/register";

Wrap one label and textarea inside the ids-textarea component. Use ids-textarea with multi-line text input. For single-line input use ids-input.

Note that ids-textarea only accepts one textarea and label each.

NameDescriptionDefaultControl
Properties
autosize
Sets width to 100% and sets height depending on content
false
-
block
Sets display block on the wrapper
false
-
invalid
Reflects the validity of the textarea
false
-
light
Light version (white background)
false
-
novalidation
Prevents validation
false
-
slots
hint
For a hint
-
tooltip
For a tooltip (ids-tooltip)
-
events
onInvalid
Emitted when invalid becomes true
-
onValid
Emitted when invalid becomes false
-

Hint

Can be used to visualize maximum length of a textarea.

Max 200 characters

Block

Autosize

States







With error

If using the required property, validation is checked on blur and on form submit.

Validation can be turned off by supplying novalidation.

This textarea is required

Accessibility

Hint can be used to visualise maximum length of a textarea. Remember that maxlength will not tell the screen reader if the maxlength is reached. A potential fix would be to render:

<span slot="hint" class="hidden" aria-live="assertive" role="alert">Max antal tecken uppnådda.</span>

If maxlength is reached. Then remove it anytime textarea.value.lengh < maxlength.