Skip to main content

Banner

Use cases:

  • Highlighting an item.
  • Flagging an item as part of a category.
  • Representing a value of unread messages.

Example

A banner for displaying information... Click to dismiss!

Declaration

<rapid-banner></rapid-banner>

Usage

@customElement({
name: 'my-element',
template: html`
<rapid-banner
${ref('bannerRef')}
@click=${x => x.handleClick()}>
<div slot="content">
A banner for displaying information... Click to dismiss!
</div>
</rapid-banner>
`,
})
export class MyElement extends GenesisElement {
@observable bannerRef: Banner;
handleClick() {
this.bannerRef.dismiss()
}
}

API

Property and attribute binding examples for Genesis Component syntax. Closing tag omitted.

Attributes

This component doesn't have any attributes.

Properties

This component doesn't have any properties.

Methods

MethodDescription
dismissDismisses the banner.

Slots

NameDescription
DefaultThe default slot for banner text, commonly a name or initials.

Parts

NameDescription
controlThe element representing the banner, which wraps the default slot.

Events fired

This component doesn't fire any events.

Events listened to

This component doesn't listen to any events.