Banner Ready
Banners are way of displaying tightly fit call to action container.
Examples #
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 | "" |
imageAlt | image-alt | Alt attribute text for the image. If not provided, image is assigned presentation role. | string | undefined |
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 | 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.
- Banner is a normal div element with text inside which doesn’t have any added functionality for assistive technologies.
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.
Tutorials
Follow these practical tutorials to learn how to build simple page layouts using Duet’s CSS Framework, Web Components and other features:
Building Layouts
TutorialsUsing CLI Tools
TutorialsCreating Custom Patterns
TutorialsServer Side Rendering
TutorialsSharing Prototypes
TutorialsUsage With Markdown
Troubleshooting
If you experience any issues while using a component, please head over to the Support page for more guidelines and help.