Anchor Design System

Notification inline3.0

The notification-inline component is a simple alert component that can display a variety of different types of messages, including error, info, success, and warning messages. It also displays an icon corresponding to the type of message being displayed.

Installation

npm i @tryg/ui-library

Usage

Individual only imports the desired component, and only needs to be included once within the application. Which is beneficial to keep the application size small.

Webcomponent
<script type="module">
  import { defineCustomElement } from '@tryg/ui-library/dist/components/anchor-notification-inline';
  defineCustomElement();
</script>
<anchor-notification-inline>This is an error message.</anchor-notification-inline>

Global only needs to be defined once in the application, but it will import all components even the ones that are not in use..

Webcomponent
<script type="module">
  import { defineCustomElements } from '@tryg/ui-library/dist/loader';
  defineCustomElements();
</script>
<anchor-notification-inline>This is an error message.</anchor-notification-inline>

Error notification

<anchor-notification-inline type="error"> This is an error message. </anchor-notification-inline>

Header slot

You can give the notification a bold header by using the header slot.

<anchor-notification-inline>
  <div slot="header">Custom Header</div>
</anchor-notification-inline>

You can give the notification a link by using the link slot. Remember that you have to use an <a> tag in the slot. And you have to use the slot="link" attribute on the <a> tag.

Example:

<anchor-notification-inline>
  Hello
  <a slot="link" href="https://anchor.tryg.com">Learn more</a>
</anchor-notification-inline>

API

Inline notification

Properties

PropertyAttributeDescriptionTypeDefault
typetypeThe type of alert to display. Can be 'error', 'info', 'success', or 'warning'."error" | "info" | "success" | "warning"undefined
uuiduuidGive this instance of notification-inline a custom ID, or keep the default.stringuuidv4()

CSS Custom Properties

NameDescription
--background-colorDEPRECATED: kept for backwards compatibility, but will be removed by April 2024
--border-colorDEPRECATED: kept for backwards compatibility, but will be removed by April 2024
--border-radiusDEPRECATED: kept for backwards compatibility, but will be removed by April 2024
--border-widthDEPRECATED: kept for backwards compatibility, but will be removed by April 2024
--gapDEPRECATED: kept for backwards compatibility, but will be removed by April 2024
--inline-icon-colorDEPRECATED: kept for backwards compatibility, but will be removed by April 2024
--lineheightDEPRECATED: kept for backwards compatibility, but will be removed by April 2024
--notification-inline-background-colorSet the background color of the
--notification-inline-border-colorSet the border color of the
--notification-inline-border-radiusSet the border radius of the
--notification-inline-border-widthSet the border width of the
--notification-inline-gapSet the gap width of the
--notification-inline-icon-colorSet the color of the inline icon in the
--notification-inline-lineheightSet the lineheight of the
--notification-inline-link-colorSet the color of the links in the
--notification-inline-text-colorSet the text color of the
--notification-inline-widthSet the width of the
--text-colorDEPRECATED: kept for backwards compatibility, but will be removed by April 2024

Dependencies

Depends on

Graph


Built with StencilJS

On this page