Skip to main content
Components

Warning text

Use the warning text component when you need to warn users about something important, such as legal consequences of an action, or lack of action, that they might take.

Read the Design System guidance for warning text

Import

import { WarningText } from 'govuk-react/warning-text';

Examples

Default

Code
<WarningText>
  Example text
</WarningText>

Long warning

Code
<WarningText>
  A very long warning message. This includes a lot of text to give a good representation of a more average length warning. That way you can see more than one line wrapping.
</WarningText>

API reference

WarningText

Use the warning text component when you need to warn users about something important, such as legal consequences of an action, or lack of action, that they might take.

PropType
iconFallbackText

The fallback text for the icon. Defaults to "Warning".

string