Skip to content

Demos

Displaying error status

Failure text
<FormStatus text="Failure text" />

Displaying information status

Long info nisl tempus hendrerit tortor dapibus nascetur taciti porta risus cursus fusce platea enim curabitur proin nibh ut luctus magnis metus
<FormStatus
  title="Hover title"
  text="Long info nisl tempus hendrerit tortor dapibus nascetur taciti porta risus cursus fusce platea enim curabitur proin nibh ut luctus magnis metus"
  state="information"
/>

Displaying warning status

Warningmessage. Take notice!
<FormStatus state="warning" variant="outlined">
  Warningmessage. Take notice!
</FormStatus>

Displaying marketing status

Marketingmessage. What a deal!
<FormStatus state="marketing" variant="outlined">
  Marketingmessage. What a deal!
</FormStatus>

Stretching the status message

NB: The inner text has a max-width of var(--prose-max-width) (defaults to 60ch) to ensure we do not exceed characters limit per line for accessibility reasons.

Long info nisl tempus hendrerit tortor dapibus nascetur taciti porta risus cursus fusce platea enim curabitur proin nibh ut luctus magnis metus
<FormStatus
  stretch={true}
  text="Long info nisl tempus hendrerit tortor dapibus nascetur taciti porta risus cursus fusce platea enim curabitur proin nibh ut luctus magnis metus"
  state="warning"
/>

Used by the Input Component

You have to fill in this field
<Input
  label="Input with status"
  status="You have to fill in this field"
  value="Input value"
/>

With a custom-styled content

My info with a link and more text
const CustomStatus = () => (
  <>
    My info <Link href="/">with a link</Link> and more text
  </>
)
render(
  <Input
    label="Input with custom status"
    status={<CustomStatus />}
    statusState="information"
    value="Input value"
  />
)

Large variant

My HTML with a link and more text
render(
  <FormStatus state="information" size="large" variant="outlined">
    My HTML{' '}
    <Anchor href="/" target="_blank">
      with a link
    </Anchor>{' '}
    and more text
  </FormStatus>
)

In combination with the Icon component

<Icon
  icon={<InfoIcon />}
  size="medium"
  title="Some title"
  inheritColor={false}
  right
/>
<Icon
  icon={WarnIcon}
  size="medium"
  title="Some title"
  inheritColor={false}
  right
/>
<Icon
  icon={ErrorIcon}
  size="medium"
  title="Some title"
  inheritColor={false}
  right
/>
<Icon
  icon={MarketingIcon}
  size="medium"
  title="Some title"
  inheritColor={false}
/>