React-Bootstrap Close Button Variants Last Updated : 28 Apr, 2025 Comments Improve Suggest changes 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 info U unstoppablepandu Follow Improve Article Tags : Web Technologies ReactJS Geeks Premier League React-Bootstrap Geeks Premier League 2023 +1 More Explore React Tutorial 5 min read React FundamentalsReact Introduction 6 min read React Environment Setup 3 min read React JS ReactDOM 2 min read React JSX 5 min read ReactJS Rendering Elements 3 min read React Lists 4 min read React Forms 4 min read ReactJS Keys 4 min read Components in ReactReact Components 4 min read ReactJS Functional Components 4 min read React Class Components 3 min read ReactJS Pure Components 4 min read ReactJS Container and Presentational Pattern in Components 2 min read ReactJS PropTypes 5 min read React Lifecycle 7 min read React HooksReact Hooks 8 min read React useState Hook 5 min read ReactJS useEffect Hook 5 min read Routing in ReactReact Router 5 min read React JS Types of Routers 10 min read Advanced React ConceptsLazy Loading in React and How to Implement it ? 4 min read ReactJS Higher-Order Components 5 min read Code Splitting in React 4 min read React ProjectsCreate ToDo App using ReactJS 3 min read Create a Quiz App using ReactJS 4 min read Create a Coin Flipping App using ReactJS 3 min read How to create a Color-Box App using ReactJS? 4 min read Dice Rolling App using ReactJS 4 min read Guess the number with React 3 min read Like