GC Design SystemComponents
GC Design System Start to use Page templates overviewBasic page Components overviewAlertBreadcrumbsButtonCardCheckboxesContainerDate inputDate modifiedDetailsError messageError summaryFieldsetFile uploaderFooterGridHeaderHeadingIconInputLanguage toggleLinkNoticePaginationRadiosScreenreader-onlySearchSelectSide navigationSignatureStepperTableTextTextareaTheme and topic menuTop navigation CSS Shortcuts overview Reset styles Responsive layoutState Box sizingContainer sizingDisplayOverflowPositionVisibility FontFont familyFont sizeFont styleFont weightLine heightLink colourLink sizeLink text decorationList styleText alignText colourText overflowText transformWord break MarginPadding Align contentAlign itemsAlign selfFlexFlex directionFlex growFlex shrinkFlex wrapGapGrid columnsGrid rowsJustify contentJustify itemsJustify selfOrderPlace contentPlace itemsPlace self Background colourBorder colourBorder radiusBorder styleBorder width Icon namesIcon sizeImage CursorPointer eventsTransition Styles overviewDesign tokensColourSpacingTypography Contact usGet InvolvedFind a demo

Alert
<gcds-alert>

Also called: message, inline message. The alert is an interactive object that communicates important information to the user.

Alert component preview

On this page

Coding and accessibility for alerts

Define the alert role

Use the alert-role attribute to categorize the alert as info, warning, danger or success. This choice determines the visual styling of the alert and communicates the urgency or importance of the message to people.

Specify the alert title

Use the heading attribute to create a clear and informative title for the alert. Make sure the title conveys the message’s purpose.

Examples

Explore the different ways you can configure the component. Each example shows a working implementation and ready-to-copy code.

In this section

Essential attributes

heading

Use heading to define the title of the alert.
<gcds-alert
  heading="You already have an application in progress"
></gcds-alert>

Optional attributes

These attributes allow you to customize or extend the component’s behaviour and presentation.

alert-role

Use alert-role to set the style of the alert. Choose from:
  • info
  • success
  • warning
  • danger
<gcds-alert
  heading="Your changes have been saved"
  alert-role="success"
></gcds-alert>

container

Use container to define the container width for the alert content.
<gcds-alert
  heading="You already have an application in progress"
  container="sm"
></gcds-alert>

hide-close-btn

Set hide-close-btn to true to hide the dismiss button. By default, it’s set to false, which displays the dismiss button.
<gcds-alert
  heading="You already have an application in progress"
  hide-close-btn="true"
></gcds-alert>

hide-role-icon

Set hide-role-icon to true to hide the alert’s role icon. By default, it’s set to false, which displays the icon.
<gcds-alert
  heading="You already have an application in progress"
  hide-role-icon="true"
></gcds-alert>

is-fixed

Set is-fixed to true to fix the alert’s position at the top. By default, it’s set to false.
<gcds-alert
  heading="You already have an application in progress"
  is-fixed="true"
></gcds-alert>

Slots

The default slot allows you to inject custom content into the component’s primary content area, and named slots, into specific areas.

default

Use the default slot to add any type of content to the alert’s message. You can add things like text, links, or buttons.
<gcds-alert heading="You already have an application in progress">
  <p>Message.</p>
</gcds-alert>
Code builder Generate an instance of the component you need by selecting its code properties.
  • Explore by choosing different code values to generate the instance you want.
  • Get the code and pull it into your environment.
  • Add any copy you need to the component (like text for a label).
Note: The code builder uses English for all code elements, which follows standard practice.

Message.

Help us improve Have questions or a request? Give feedback on our contact form. Something's wrong? Raise it through GitHub with an account. You'll have access to the team's direct responses, progress made on your issue, and issues raised by others. Give feedback Report an issue on GitHub
2026-09-09