Skip to content

Banner

Used to display a visual promotional message.

Importing

To use the banner component, first you need to register the component inside the page. You can register the component manually by importing the register function:

ts
import { register } from "@tapsioss/web-components/banner";

register(); // Now the banner component is ready to use!
ts
import { registerBanner } from "@tapsioss/web-components";

registerBanner(); // Now the banner component is ready to use!

Also you can automatically register the component by importing it with the following approach:

ts
import "@tapsioss/web-components/banner/element";

TIP

If you want to use all the component in your app, you can call registerAll at the root of your project.

ts
import { registerAll } from "@tapsioss/web-components";

registerAll(); // All the components are now available

In the React package, you can easily add the component using the following code:

ts
import { Banner } from "@tapsioss/react-components";

Component Usage

html
<tapsi-banner></tapsi-banner>
tsx
<Banner />

Properties

NameAttribute NameDescriptionTypeDefault Value
headingheadingThe heading text to display in the banner.string""
descriptiondescriptionThe description text to display in the banner.string""
imageimageThe URL of the background image to display in the banner.string""
variantvariantThe variant style of the banner."default" | "hero""default"
backgroundColorbackground-colorThe background color of the banner.stringDEFAULT_BACKGROUND_COLOR
textColortext-colorThe text color of the banner.stringDEFAULT_TEXT_COLOR

Slots

NameValueDescription
DEFAULT-The slot for action element.
ACTIONactionThe slot for action element.

TIP

The value of slots are available for developer as JavaScript Variables:

ts
// Option 1
import { BannerSlots } from "@tapsioss/web-components";

// Option 2
import { Slots } from "@tapsioss/web-components/banner";
ts
// Option 1
import { BannerSlots } from "@tapsioss/react-components";

// Option 2
import { Slots } from "@tapsioss/react-components/Banner";

Created with 🧡