React-Bootstrap Close Button Variants Last Updated : 28 Apr, 2025 Summarize Comments Improve Suggest changes Share Like Article Like Report React-Bootstrap Close Button Variants can defined as the CloseButton component that provides the flexibility to create a close button with a range of variants, enabling you to style the button according to your specific design requirements. Bootstrap's button variants, offer you the means to harmonize the appearance of the close button with the overall aesthetic of your application. variant property values: white: The close button will be in white colordark: The close button will be in dark colorSyntax: <CloseButton variant = "value" />Example 1: This example creates the close button with dark and white color buttons using variant property. JavaScript import { CloseButton } from 'react-bootstrap'; const App = () => { return ( <div className="App"> <h1 style={ { color: 'green', textAlign: 'center' } }> GeeksforGeeks </h1> <h5 style={ { textAlign: 'center' } }>React-Bootstrap Close Button Variants </h5> <br></br> <div style={{ textAlign: 'center' }}> <CloseButton variant="dark" /> <div style={{ backgroundColor: 'black' }}> <CloseButton variant="white" /> </div> </div> </div> ); }; export default App; Output: Example 2: This example creates the close button of white variant for welcome popup on website. JavaScript import React, { useState } from 'react'; import 'bootstrap/dist/css/bootstrap.min.css'; // Import Bootstrap CSS import { CloseButton, Container } from 'react-bootstrap'; const App = () => { const [ showWelcomeBox, setShowWelcomeBoxVisible ] = useState(true); const handleClose = () => { setShowWelcomeBoxVisible(false); }; return ( <Container className="App text-center"> <div className='mt-0'> <h1 style={{ color: 'green' }}> GeeksforGeeks </h1> <h5> React-Bootstrap Close Button Variants </h5> </div> <div> {showWelcomeBox && ( <div className="mx-auto d-flex justify-content-center align-items-center fixed-top bg-success" style={{ marginTop: "100px" }}> <CloseButton variant="white" onClick={handleClose} /> <p className="text-white"> Hi Geeks ! Welcome to GeeksforGeeks </p> </div> )} </div> </Container> ); }; export default App; Output: Comment More infoAdvertise with us Next Article Bootstrap 5 Close button White variant U unstoppablepandu Follow Improve Article Tags : Web Technologies ReactJS Geeks Premier League React-Bootstrap Geeks Premier League 2023 +1 More Similar Reads React-Bootstrap Close Button API React-Bootstrap close button API is a way to import Close Button provided by React Bootstrap. In this article we are going to explore Close Button API. Close button is used to close a dialog box or pop up in React Bootstrap.Close Button Props:variant: It is used for rendering the button in different 2 min read Bootstrap 5 Close button White variant Bootstrap 5 Close button is used to add more user access and enhance user experience to a website and its components. Generally, the default version of this button is dark/black and it goes universally with all the colors except the dark/black colored background or component which goes well and look 2 min read React Bootstrap close button disabled state React-Bootstrap Close Button Disabled state is a disabled button that is unclickable and unusable to prevent user interactions. It is a boolean attribute. We will learn more about it by creating a React app. React-Bootstrap Used Attributes:disabled: This attribute is used to disable the button. It i 2 min read React Bootstrap Close Button Component A React Bootstrap Close Button Component is a generic close button for dismissing content such as modals and alerts. You can use it to provide an option to close or hide a component with a simple click. You can customize its appearance and behavior with props such as variant, aria-label, onClick, an 2 min read Bootstrap 5 Close Button SASS Bootstrap 5 Close button SASS can be used to change the default values provided for the close button by customizing scss file of bootstrap 5. SASS variables of Close button:$btn-close-width: This variable provides the width of the close button. By default, it is 1em.$btn-close-height: This variable 5 min read React-Bootstrap Button Component Introduction: React-Bootstrap is a front-end framework that was designed keeping react in mind. Bootstrap was re-built and revamped for React, hence it is known as React-Bootstrap. Buttons are used to perform actions on the website and they play a crucial role in the front-end part. Buttons props: v 4 min read Like