FormStatus (StatusMessage)

Description

The FormStatus is a simple component meant for displaying the status of a form ( displaying form errors, messages etc. ) The FormStatus component should be positioned relative to the form or form input to which it referring to.

Also, the FormStatus is used inside of many other form components.

The FormStatus component cooperates together with the GlobalStatus component to summaries and have several status messages in once place.

Use the FormStatus icons only

  • InfoIcon   info
  • WarnIcon   error
  • ErrorIcon error
import { InfoIcon } from '@dnb/eufemia/components/FormStatus
render(<InfoIcon />)

... or in combination with the Icon component. Have a look at this example.

Width alignment

In order to enhance accessibility (readability), the FormStatus will align its width to a linked component. That means, if the FormStatus is build into the Input component, it will inherit the width of the input.

The min-width is set to be 12rem. Use CSS min-width or max-width to set a custom (manual) width.

Demos

FormStatus displaying error status

Failure text

FormStatus displaying info status

Long info nisl tempus hendrerit tortor dapibus nascetur taciti porta risus cursus fusce platea enim curabitur proin nibh ut luctus magnis metus

A stretched and independent FormStatus

NB: The inner text gets a max width of 47rem to ensure we not exceed 70 characters limit per line.

Long info nisl tempus hendrerit tortor dapibus nascetur taciti porta risus cursus fusce platea enim curabitur proin nibh ut luctus magnis metus

FormStatus displaying warn status

Warningmessage. Take notice!

A form status, used by the Input Component

You have to fill in this field

A form status, with a custom styled content

My info with a link and more text

A form status with plain text/HTML

My HTML with a link and more text

In combination with the Icon component