Skip to main content

Banner Ready

Banners are way of displaying tightly fit call to action container.

Examples #

Open in new window
<duet-banner
size="auto"
icon="category-apartment"
image="https://www.duetds.com/assets/img/example-banner1.jpg"
>

<span slot="heading">
Kasko-vakuutus autosi turvaksi, lorem ipsum!
</span>
<span slot="description">
Optional paragraph. Kasko-vakuutus autosi turvaksi,
lorem ipsum dolor sit.
</span>
<duet-button
slot="action"
margin="none"
variation="primary"
icon="navigation-arrow-right"
icon-right
>

Call to action
</duet-button>
</duet-banner>
Open in new window
<style>
body {
padding: 40px;
}
.banner-grid {
display: grid;
grid-template-columns: 1fr;
gap: var(--space-xx-large);
}

/* media-query-small */
@media (min-width: 36em) {
.banner-grid {
grid-template-columns: 1fr 1fr;
}

.banner-grid *:nth-child(1) {
grid-column: 1 / span 2;
}
}

</style>
<div class="banner-grid">
<duet-banner
image="https://www.duetds.com/assets/img/example-banner2.jpg"
icon="category-apartment"
margin="none"
>

<span slot="heading">
Sijoitamme sinun varasi kuten omamme
</span>
<span slot="description">
Mitä, jos voit sijoittaa omat varasi kuten me LähiTapiolassa – pitkäjänteisesti ja ammattitaitoisesti? Tutustu sijoituskohteisiin, joihin me itse uskomme.
</span>
<duet-button
slot="action"
margin="none"
variation="primary"
icon="navigation-arrow-right"
icon-right
>

Call to action
</duet-button>
</duet-banner>
<duet-banner
image="https://www.duetds.com/assets/img/example-banner2.jpg"
icon="category-apartment"
margin="none"
>

<span slot="heading">
Sijoitamme sinun varasi kuten omamme
</span>
<span slot="description">
Mitä, jos voit sijoittaa omat varasi kuten me LähiTapiolassa – pitkäjänteisesti ja ammattitaitoisesti? Tutustu sijoituskohteisiin, joihin me itse uskomme.
</span>
<duet-button
slot="action"
margin="none"
variation="primary"
icon="navigation-arrow-right"
icon-right
>

Call to action
</duet-button>
</duet-banner>

<duet-banner
image="https://www.duetds.com/assets/img/example-banner2.jpg"
icon="category-apartment"
margin="none"
>

<span slot="heading">
Sijoitamme sinun varasi kuten omamme
</span>
<span slot="description">
Mitä, jos voit sijoittaa omat varasi kuten me LähiTapiolassa – pitkäjänteisesti ja ammattitaitoisesti? Tutustu sijoituskohteisiin, joihin me itse uskomme.
</span>
<duet-button
slot="action"
margin="none"
variation="primary"
icon="navigation-arrow-right"
icon-right
>

Call to action
</duet-button>
</duet-banner>
</div>

Properties #

Property Attribute Description Type Default
backgroundColor background-color Background color. string "primary-lighter"
headingLevel heading-level The actual heading level used in the HTML markup. "h1" | "h2" | "h3" | "h4" | "h5" | "h6" "h2"
icon icon Icon. string ""
iconBackgroundColor icon-background-color Icon background color. string "primary"
iconColor icon-color Icon color. string "gray-lightest"
image image Image. Example image is 512x341; string ""
margin margin Controls the margin of the component. "auto" | "none" "auto"
size size Maximum size of the banner. The banner will automatically switch to smaller sizes when space is not available. Sizes "large" and "medium" are horizontal, "small" is vertical, "large" | "medium" | "small" "large"
sources sources Array of sources for responsive images. Sources have the properties of element. This is an experimental feature and might be changed without notice. DuetSource[] | string undefined
textColor text-color Text color. string "secondary"
theme theme Theme. "" | "default" | "turva" ""

Slots #

Slot Description
"action" Slot for action button.
"description" Slot for description content.
"heading" Slot for heading content. Only span should be used in this slot.

Usage #

This section includes guidelines for designers and developers about the usage of this component in different contexts.

When to use #

  • When you need a call to action which customers can click to go quickly to the wanted resource.

When not to use #

  • Don't place a banner as a sole element in a page.

Accessibility #

This component has been validated to meet the WCAG 2.1 AA accessibility guidelines. You can find additional information regarding accessibility of this component below.


Integration

For integration, event and theming guidelines, please see Using Components. This documentation explains how to implement and use Duet’s components across different technologies like Angular, React or Vanilla JavaScript.

Integration guidelines


Tutorials

Follow these practical tutorials to learn how to build simple page layouts using Duet’s CSS Framework, Web Components and other features:

Tutorials

Building Layouts

Tutorials

Using CLI Tools

Tutorials

Creating Custom Patterns

Tutorials

Server Side Rendering

Tutorials

Sharing Prototypes

Tutorials

Usage With Markdown


Troubleshooting

If you experience any issues while using a component, please head over to the Support page for more guidelines and help.