Bootstrap Components
Theme uses React Bootstrap plugin which extends Bootstrap framework and makes using Bootstrap in React easy. Check out docs lower on the page or visit plugin documentation here.
Alert
Provide contextual feedback messages for typical user actions with the handful of available and flexible alert messages. See the React Bootstrap documentation for more details.
import { Alert } from 'react-bootstrap'
const Component = () => {
const [visible, setVisible] = React.useState(false)
return (
<Alert show={visible} onClose={() => setVisible(false)} variant="primary" className="d-flex align-items-center pe-3">
<Icon icon="delivery-1" className="d-none d-sm-block w-3rem h-3rem svg-icon-light flex-shrink-0 me-3" />This is a primary alert—check it out!
</Alert>
)
}
export default Component
Badge
Small count and labeling component. See the React Bootstrap documentation for more details.
Add -light
suffix to the class name to get lighter tones on badges.
Example heading New
Example heading New
Example heading New
Example heading New
Example heading New
import { Badge } from 'react-bootstrap'
const Component = () => {
return (
<h2>Example heading <Badge bg="danger-light" text="danger">New</Badge></h2>
<h3>Example heading <Badge bg="primary-light" text="primary">New</Badge></h3>
)
}
export default Component
Card
Bootstrap’s cards provide a flexible and extensible content container with multiple variants and options.. See the React Bootstrap documentation for more details.
Card title
Some quick example text to build on the card title and make up the bulk of the card's content.
Go somewhereimport { Card, Button } from 'react-bootstrap'
const Component = () => {
return (
<Card>
<Card.Img top src="/img/blog/christopher-campbell-28571-unsplash.jpg" alt="Card image cap" />
<Card.Body>
<CardTitle as="h4">Card title</CardTitle>
<Card.Text>Some quick example text to build on the card title and make up the bulk of the card's content.</Card.Text>
<Button href="#" variant="outline-primary">Go somewhere</Button>
</Card.Body>
</Card>
)
}
export default Component
Dropdowns
Toggle contextual overlays for displaying lists of links and more with the Bootstrap dropdown plugin. See the React Bootstrap documentation for more details.
import { Dropdown } from 'react-bootstrap'
const Component = () => {
return (
<Dropdown className="d-inline-block" drop="down">
<Dropdown.Toggle variant="outline-dark" caret>Default</Dropdown.Toggle>
<Dropdown.Menu>
<Dropdown.Header className="fw-normal">
Dropdown header
</Dropdown.Header>
<Dropdown.Item href="#">Action</Dropdown.Item>
<Dropdown.Item href="#">Another action</Dropdown.Item>
<Dropdown.Item href="#">Something else here</Dropdown.Item>
<Dropdown.Divider />
<Dropdown.Item href="#">Something else here</Dropdown.Item>
</Dropdown.Menu>
</Dropdown>
)
}
export default Component
Forms
Examples and usage guidelines for form control styles, layout options, and custom components for creating a wide variety of forms. See the React Bootstrap documentation for more details.
Form Group
Input Sizes
Input Group
Custom Inputs
import { Form } from 'react-bootstrap'
export default () => {
return (
<Form>
<div className="mb-4>
<Form.Label htmlFor="exampleInputEmail1">Email address</Form.Label>
<Form.Control id="exampleInputEmail1" type="email" aria-describedby="emailHelp" placeholder="Enter email" />
<Form.Text id="emailHelp">We'll never share your email with anyone else.</Form.Text>
</div>
</Form>
)
}
List Group
List groups are a flexible and powerful component for displaying a series of content. Modify and extend them to support just about any content within. See the React Bootstrap documentation for more details.
import { ListGroup } from 'react-bootstrap'
export default () => {
return (
<ListGroup>
<ListGroup.Item>Cras justo odio</ListGroup.Item>
<ListGroup.Item>Dapibus ac facilisis in</ListGroup.Item>
<ListGroup.Item>Morbi leo risus</ListGroup.Item>
<ListGroup.Item>Porta ac consectetur ac</ListGroup.Item>
<ListGroup.Item>Vestibulum at eros</ListGroup.Item>
</ListGroup>
)
}
Modal
Use Bootstrap’s JavaScript modal plugin to add dialogs to your site for lightboxes, user notifications, or completely custom content. See the React Bootstrap documentation for more details.
import { Modal, Button } from 'react-bootstrap'
export default () => {
const [modal, setModal] = React.useState(false)
const onClick = () => {
setModal(!modal)
}
return (
<>
<Button onClick={onClick}>Launch demo modal</Button>
<Modal show={modal} onHide={onClick}>
<Modal.Header closeButton>
<Modal.Title as="h2">
Modal heading
</Modal.Title>
</Modal.Header>
<Modal.Body>
<p className="text-muted">
<strong>Pellentesque habitant morbi tristique</strong> senectus et
netus et malesuada fames ac turpis egestas. Vestibulum tortor
quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec
eu libero sit amet quam egestas semper.{" "}
<em>Aenean ultricies mi vitae est.</em> Mauris placerat eleifend
leo. Quisque sit amet est et sapien ullamcorper pharetra.
Vestibulum erat wisi, condimentum sed, <code>commodo vitae</code>,
ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt
condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac
dui. <a href="#">Donec non enim</a> in turpis pulvinar facilisis.
Ut felis.
</p>
</Modal.Body>
<Modal.Footer className="justify-content-end">
<Button onClick={onClick}>Save changes</Button>
<Button variant="outline-muted" onClick={onClick}>
Close
</Button>
</Modal.Footer>
</Modal>
<>
)
}
Pagination
Pagination to indicate a series of related content exists across multiple pages. See the React Bootstrap documentation for more details.
import { Pagination } from 'react-bootstrap'
export default () => {
return (
<Pagination aria-label="Page navigation example">
<Pagination.First href="#">Previous</Pagination.First>
<Pagination.Item active href="#">
1
</Pagination.Item>
<Pagination.Item href="#">2</Pagination.Item>
<Pagination.Item href="#">3</Pagination.Item>
<Pagination.Item href="#">4</Pagination.Item>
<Pagination.Item href="#">5</Pagination.Item>
<Pagination.Next href="#">Next</Pagination.Next>
</Pagination>
)
}
Progress
Bootstrap custom progress bars featuring support for stacked bars, animated backgrounds, and text labels. See the React Bootstrap documentation for more details.
import { ProgressBar } from 'react-bootstrap'
export default () => {
return (
<>
<ProgressBar now={25} variant="primary" />
<ProgressBar now={50} variant="info" />
<ProgressBar now={75} variant="success" />
<ProgressBar now={100} variant="secondary" />
</>
)
}
Tooltips
Custom Bootstrap tooltips with CSS and JavaScript using CSS3 for animations and data-attributes for local title storage. See the React Bootstrap documentation for more details.
import { Button, Tooltip, OverlayTrigger } from 'react-bootstrap'
export default () => {
return (
<>
{["top", "right", "bottom", "left"].map((placement) => (
<OverlayTrigger
key={placement}
placement={placement}
overlay={
<Tooltip id={`tooltip-${placement}`}>
Tooltip on <strong>{placement}</strong>.
</Tooltip>
}
>
<Button variant="outline-primary" className="mb-1 me-1">
Tooltip on {placement}
</Button>
</OverlayTrigger>
))}
</>
)
}