Skip to content
Iris Hub

Close Button

The close button is a small, accessible "x" for dismissing alerts, toasts, modals, offcanvas panels, chips and list items. Always set an aria-label, use data-bs-dismiss to close Bootstrap components, and place it on dark surfaces with data-bs-theme="dark".

1Basic close button

A plain .btn-close; always give it an aria-label.

2Disabled

The disabled attribute fades the button and blocks clicks.

3On dark backgrounds

Inside data-bs-theme="dark" the icon turns white automatically.

4In an alert

data-bs-dismiss="alert" removes the alert when the close button is clicked.

5In a toast

The close button in a toast header uses data-bs-dismiss="toast"; the button below shows it again.

6In a modal header

A static modal preview: the close button sits at the end of the header.

7Card corner

Positioned in the top-right corner of a card to dismiss a tip.

Quick tip

We keep things simple, so you can focus on what matters to you.

8Chips with close

Small close buttons inside chips remove a selected value.

Mateo RossiZoe LindqvistAva Ibrahim

9Sizes

Scale the button with font-size; it is built from an em-sized background icon.

10In an offcanvas

The close button in an offcanvas header uses data-bs-dismiss="offcanvas".

Filters

Our sommelier has paired each dish with wines from small family vineyards.

11Remove uploaded images

Small round close buttons on thumbnails in an upload preview.

Upload 1
Upload 2
Upload 3

12Remove list items

A close button at the end of each list item, e.g. email attachments.

  • five-wines-to-pair-with-a-summer-dinner.pdf
  • meet-the-farmers-behind-our-menu.png
  • a-beginner-s-guide-to-getting-started.pdf

13Clear a search field

A close button inside an input group clears the search.

14Notification panel header

A panel title with a mark-all link and a close button.

NotificationsMark all read
We have been feeding this neighbourhood for over a decade, and we still love it.

15Cart item remove

A close button removes a product row from the mini cart.

Burrata with tomatoes
Burrata with tomatoes
Qty 1 · $13.00

16On coloured surfaces

On primary, success or danger backgrounds use a dark theme wrapper so the icon stays visible.

We listen first, then build a plan around what you actually need.
Payment received.

17Close with a label

When space allows, pair the icon with a visible word for clarity.

18Filter chips row

A row of active filters, each removable, with a clear-all link.

Active filters:DrinksRating 4+Free shippingMelbourneClear all

19Promo banner

A full-width dismissible banner at the top of a page.

20Modal with close buttons

A real modal: the header close button and the footer button both use data-bs-dismiss="modal".