Close button

Source: https://getbootstrap.com/docs/6.0/components/close-button

A generic close button for dismissing content like modals and alerts.

Example

Provide an option to dismiss or close a component with .btn-close. The icon is rendered with a CSS mask-image, so it inherits the color from the .btn-close class—no inline SVG required. Be sure to include text for screen readers, as we’ve done with aria-label.

<Example code={<button type="button" class="btn-close" aria-label="Close"></button>} />

Disabled state

Disabled close buttons change their opacity. We’ve also applied pointer-events: none and user-select: none to preventing hover and active states from triggering.

<Example code={<button type="button" class="btn-close" disabled aria-label="Close"></button>} />

Dark variant

Add data-bs-theme="dark" to the .btn-close, or to its parent element, to invert the close button. This happens automatically when in dark mode.

&lt;button type="button" class="btn-close" aria-label="Close">&lt;/button>
&lt;button type="button" class="btn-close" disabled aria-label="Close">&lt;/button>

</div>`} />

CSS

Variables