| title | Banner | ||||||
|---|---|---|---|---|---|---|---|
| description | A banner is a type of Notice, delivering system and engagement messaging. It is highly intrusive and should be used sparingly and appropriately. | ||||||
| status | ready | ||||||
| thumb | true | ||||||
| image | assets/images/components/banner.png | ||||||
| storybook | https://dialtone.dialpad.com/vue/?path=/story/components-banner--default | ||||||
| figma_url | https://www.figma.com/design/W58r5BkO8qTw3vem9YieJd/DT9-Component-Library--Rebrand-2025-?node-id=4516-0 | ||||||
| keywords |
|
<dt-stack gap="200" class="d-w100p" align="center">
<dt-banner title="Example banner" kind="info" class="d-ps-relative d-zi-base">
Message body with a <dt-link kind="muted">Link</dt-link>
<template #action>
<dt-button :size="200" kind="muted" importance="outlined">Action</dt-button>
</template>
</dt-banner>
<dt-stack direction="row">
<dt-button @click="toggleBanner('example-pinned')">Pin to top</dt-button>
</dt-stack>
</dt-stack>System banners are used for system messaging. They are full-width notices placed in one of two locations:
- Above everything else: If the banner is related to the entire app (e.g. the user lost internet service), place the banner first. These should not be dismissable until the issue is resolved. To pin the banner to the top of the app, add the
.d-notice--pinnedclass. - Below the top bar: This is the default location for system banners. Use these when it affects only a particular area of the product (e.g. when the user is in Do Not Disturb mode).
Banners are a type of notice and so you can use the following Notice styles in conjunction with .d-banner.
<dt-stack direction="row" gap="200">
<dt-select-menu :label-visible="false" label="Style" :options="bannerOptions" v-model="selectedKind" />
<dt-checkbox value="important" @input="toggleImportant">Important</dt-checkbox>
<dt-button @click="toggleBanner('example-kind')">Toggle Example</dt-button>
</dt-stack><dt-banner :pinned="pinned" :important="important" :kind="selectedKind" title="Optional banner title" v-show="shownBanner === 'example-kind'" @close="closeBanner"
Message body
<dt-banner kind="base" title="Optional banner title"> Message body </dt-banner>
<dt-banner kind="error" title="Optional banner title"> Message body </dt-banner>
<dt-banner kind="info" title="Optional banner title"> Message body </dt-banner>
<dt-banner kind="success" title="Optional banner title"> Message body </dt-banner>
<dt-banner kind="warning" title="Optional banner title"> Message body </dt-banner>
<dt-banner background-image="{$background-image}" background-size="contain"> Message body </dt-banner>
<dt-banner pinned="true" kind="warning" title="Optional banner title"> Message body </dt-banner>
<dt-banner important="true" kind="warning" title="Optional banner title"> Message body </dt-banner>Pins the banner to the top of the window.
<dt-stack direction="row">
<dt-button @click="toggleBanner('example-pinned')">Toggle Example</dt-button>
</dt-stack><dt-banner :pinned="true" title="Optional banner title" v-show="shownBanner === 'example-pinned'" @close="closeBanner"
Detailed description goes here. <template #action> Action
<dt-banner
:pinned="true"
title="Optional banner title"
>
Detailed description goes here.
<template #action>
<dt-button :size="200" kind="muted" importance="outlined">Action</dt-button>
</template>
</dt-banner>