Flair Web Components: Add Flair Anywhere in Your Store | Flair

Web Components

Oct 09, 2026

On this page

Overview

Flair web components let you show Flair badges and banners anywhere in your Shopify theme, for manual placement, custom integrations, and more.

Flair badges

The <flair-badges> element adds Flair badges to products in your shop.

<flair-badges product-id="123" layout="my layout"></flair-badges>Copied!

Badge attributes

You can specify these attributes to customize your Flair badges:

Attributes will override any layout settings.

Badge CSS properties

These properties can be used to customize the display of Flair badges:

Flair banners

The <flair-banners> element adds Flair banners in your shop.

<flair-banners product-id="123" layout="my layout"></flair-banners>Copied!

Banner attributes

Attributes will override any layout settings.

Banner CSS properties

These properties can be used to customize the display of Flair banners:

Button CSS properties

These properties can be used to customize the display of Flair banner actions (aka - buttons or links):

Countdown timer CSS properties

These properties can be used to customize the display of Flair banner countdown timers:

Flair layout CSS

CSS custom properties will override Flair badge, banner and layout settings.

These properties can be used to customize the display of the <flair-badges> and <flair-banners> elements:

Common custom CSS examples

These examples use flair-badges. Replace it with flair-banners to apply them to banners.

Set the mobile font size and line height

@media only screen and (max-width:480px) {
  flair-badges { --flair-font-size: 12px; --flair-line-height: 16px; }
}Copied!

Set direction to row and center badges on mobile

@media only screen and (max-width:480px) {
  flair-badges { --flair-layout-direction: row; --flair-layout-justify-content: center; }
}Copied!

Set direction to column and center badges on mobile

@media only screen and (max-width:480px) {
  flair-badges { --flair-layout-direction: column; --flair-layout-align-items: center; }
}Copied!

Hide badges on mobile

@media only screen and (max-width:480px) {
  flair-badges { --flair-layout-display: none; }
}Copied!

Hide badges on desktop

@media only screen and (min-width:480px) {
  flair-badges { --flair-layout-display: none; }
}Copied!

Allow badge text to wrap

This is only supported for square and round badge shapes.

flair-badges { --flair-white-space: normal; }Copied!

Frequently Asked Questions

How do I add Flair badges or banners to a custom page or template?

Add the <flair-badges> or <flair-banners> element to your theme code where you want them to appear. See Flair badges and Flair banners.

How do I hide Flair badges or banners on mobile?

Use a CSS @media query that sets --flair-layout-display to none on small screens. See Hide badges on mobile for details.

Do web component attributes override my layout settings?

Yes. Attributes on Flair web components override layout settings, while CSS custom properties override styling settings.

How do I let Flair badge text wrap onto two lines?

Use CSS to set --flair-white-space to normal. This works for square and round badge shapes. See Allow badge text to wrap.

Navigation

Closecross-small