Close button

Bootstrap 5 Close button

Close button for the latest Bootstrap 5. Component used to dismiss content of modals, alerts, and popovers.


Basic example

Provide an option to dismiss or close a component with .btn-close.

        
            
          <button type="button" class="btn-close" aria-label="Close"></button>
        
        
    

Disabled

Add disabled attribute to prevent triggering hover and active states.

        
            
          <button type="button" class="btn-close" disabled aria-label="Close"></button>
        
        
    

White variant

Add btn-close-white class to change color on dark backround.

        
            
          <button type="button" class="btn-close btn-close-white" aria-label="Close"></button>