Bootstrap Button Icon with Text
Bootstrap Button Icon with Text:Bootstrap Button Icon with Text refers to a feature in the Bootstrap framework that allows the creation of buttons containing both an icon and text. By combining the "btn" class with the "btn-icon-text" class, developers can easily design buttons with an icon displayed alongside descriptive text. The icon can be chosen from a library of Bootstrap icons or customized using other icon libraries. This feature enhances user experience by providing intuitive visual cues and making the button's purpose clear. Developers can further style and customize these buttons using additional Bootstrap classes and CSS properties to match their design requirements.
Thanks for your feedback!
Your contributions will help us to improve service.
How can I create a Bootstrap button that includes both an icon and text?
The provided code is using Bootstrap classes to create a grid layout with rows and columns. Each column has a width of 3 (col-sm-3), meaning there are 4 columns in each row.
Inside each column, there is a button element with a specific Bootstrap button class (e.g., btn-primary, btn-success) and an icon from Bootstrap Icons (represented by the <i> tag with a class like "bi bi-house-fill").
The text for each button is placed next to the icon. This code generates a grid of buttons with icons and corresponding text for various actions or functionalities.
Bootstrap Button Icon with Text Example
<div class="row">
<div class="col-sm-3">
<button class="btn btn-primary"><i class="bi bi-house-fill"></i> Home</button>
</div>
<div class="col-sm-3">
<button class="btn btn-success"><i class="bi bi-plus"></i> Add</button>
</div>
<div class="col-sm-3">
<button class="btn btn-danger"><i class="bi bi-save"></i> Save</button>
</div>
<div class="col-sm-3">
<button class="btn btn-warning"><i class="bi bi-pencil"></i> Edit</button>
</div>
</div>
<div class="row">
<div class="col-sm-3">
<button class="btn btn-info"><i class="bi bi-download"></i> Download</button>
</div>
<div class="col-sm-3">
<button class="btn btn-secondary"><i class="bi bi-trash"></i> Delete</button>
</div>
<div class="col-sm-3">
<button class="btn btn-light"><i class="bi bi-upload"></i> Upload</button>
</div>
<div class="col-sm-3">
<button class="btn btn-dark"><i class="bi bi-search"></i> Search</button>
</div>
</div>
<div class="row">
<div class="col-sm-3">
<button class="btn btn-primary"><i class="bi bi-envelope"></i> Email</button>
</div>
<div class="col-sm-3">
<button class="btn btn-success"><i class="bi bi-gear"></i> Settings</button>
</div>
<div class="col-sm-3">
<button class="btn btn-danger"><i class="bi bi-share"></i> Share</button>
</div>
<div class="col-sm-3">
<button class="btn btn-warning"><i class="bi bi-arrow-clockwise"></i> Refresh</button>
</div>
</div>
<div class="row">
<div class="col-sm-3">
<button class="btn btn-secondary"><i class="bi bi-calendar"></i> Calendar</button>
</div>
<div class="col-sm-3">
<button class="btn btn-info"><i class="bi bi-printer"></i> Print</button>
</div>
<div class="col-sm-3">
<button class="btn btn-warning"><i class="bi bi-arrow-down"></i> Arrow Down</button>
</div>
<div class="col-sm-3">
<button class="btn btn-secondary"><i class="bi bi-arrow-left"></i> Arrow Left</button>
</div>
<div class="col-sm-3">
<button class="btn btn-info"><i class="bi bi-arrow-right"></i> Arrow Right</button>
</div>
<div class="col-sm-3">
<button class="btn btn-light"><i class="bi bi-arrow-up"></i> Arrow Up</button>
</div>
<div class="col-sm-3">
<button class="btn btn-dark"><i class="bi bi-soundwave"></i> Audio</button>
</div>
<div class="col-sm-3">
<button class="btn btn-primary"><i class="bi bi-bell"></i> Bell</button>
</div>
<div class="col-sm-3">
<button class="btn btn-success"><i class="bi bi-book"></i> Book</button>
</div>
<div class="col-sm-3">
<button class="btn btn-danger"><i class="bi bi-bookmark"></i> Bookmark</button>
</div>
<div class="col-sm-3">
<button class="btn btn-warning"><i class="bi bi-briefcase"></i> Briefcase</button>
</div>
<div class="col-sm-3">
<button class="btn btn-secondary"><i class="bi bi-calendar"></i> Calendar</button>
</div>
<div class="col-sm-3">
<button class="btn btn-info"><i class="bi bi-camera"></i> Camera</button>
</div>
<div class="col-sm-3">
<button class="btn btn-light"><i class="bi bi-check"></i> Check</button>
</div>
<div class="col-sm-3">
<button class="btn btn-dark"><i class="bi bi-exclamation-circle-fill"></i> Circle Exclamation</button>
</div>
<div class="col-sm-3">
<button class="btn btn-primary"><i class="bi bi-info-circle"></i> Circle Info</button>
</div>
<div class="col-sm-3">
<button class="btn btn-success"><i class="bi bi-question-circle"></i> Circle Question</button>
</div>
<div class="col-sm-3">
<button class="btn btn-danger"><i class="bi bi-x"></i> Close</button>
</div>
<div class="col-sm-3">
<button class="btn btn-secondary"><i class="bi bi-chat"></i> Comment</button>
</div>
<div class="col-sm-3">
<button class="btn btn-info"><i class="bi bi-clipboard"></i> Copy</button>
</div>
<div class="col-sm-3">
<button class="btn btn-light"><i class="bi bi-credit-card"></i> Credit Card</button>
</div>
<div class="col-sm-3">
<button class="btn btn-dark"><i class="bi bi-scissors"></i> Cut</button>
</div>
<div class="col-sm-3">
<button class="btn btn-primary"><i class="bi bi-speedometer2""></i> Dashboard</button>
</div>
<div class=" col-sm-3">
<button class="btn btn-success"><i class="bi bi-file"></i> Document</button>
</div>
<div class="col-sm-3">
<button class="btn btn-danger"><i class="bi bi-download"></i> Download</button>
</div>
<div class="col-sm-3">
<button class="btn btn-warning"><i class="bi bi-edit"></i> Edit</button>
</div>
<div class="col-sm-3">
<button class="btn btn-secondary"><i class="bi bi-envelope"></i> Envelope</button>
</div>
<div class="col-sm-3">
<button class="btn btn-info"><i class="bi bi-exclamation"></i> Exclamation</button>
</div>
<div class="col-sm-3">
<button class="btn btn-light"><i class="bi bi-external-link"></i> External Link</button>
</div>
<div class="col-sm-3">
<button class="btn btn-dark"><i class="bi bi-eye"></i> Eye</button>
</div>
<div class="col-sm-3">
<button class="btn btn-primary"><i class="bi bi-file"></i> File</button>
</div>
<div class="col-sm-3">
<button class="btn btn-success"><i class="bi bi-film"></i> Film</button>
</div>
<div class="col-sm-3">
<button class="btn btn-danger"><i class="bi bi-folder"></i> Folder</button>
</div>
<div class="col-sm-3">
<button class="btn btn-warning"><i class="bi bi-fonts"></i> Font</button>
</div>
<div class="col-sm-3">
<button class="btn btn-secondary"><i class="bi bi-globe"></i> Globe</button>
</div>
<div class="col-sm-3">
<button class="btn btn-info"><i class="bi bi-graph-up"></i> Graph</button>
</div>
<div class="col-sm-3">
<button class="btn btn-light"><i class="bi bi-grid"></i> Grid</button>
</div>
<div class="col-sm-3">
<button class="btn btn-dark"><i class="bi bi-heart"></i> Heart</button>
</div>
<div class="col-sm-3">
<button class="btn btn-primary"><i class="bi bi-bi bi-question-circle-fill"></i> Help</button>
</div>
<div class="col-sm-3">
<button class="btn btn-success"><i class="bi bi-house"></i> Home</button>
</div>
<div class="col-sm-3">
<button class="btn btn-danger"><i class="bi bi-info"></i> Info</button>
</div>
<div class="col-sm-3">
<button class="btn btn-warning"><i class="bi bi-key"></i> Key</button>
</div>
<div class="col-sm-3">
<button class="btn btn-secondary"><i class="bi bi-laptop"></i> Laptop</button>
</div>
<div class="col-sm-3">
<button class="btn btn-info"><i class="bi bi-alt"></i> List Alt</button>
</div>
<div class="col-sm-3">
<button class="btn btn-light"><i class="bi bi-lock"></i> Lock</button>
</div>
<div class="col-sm-3">
<button class="btn btn-dark"><i class="bi bi-envelope"></i> Mail</button>
</div>
<div class="col-sm-3">
<button class="btn btn-primary"><i class="bi bi-map"></i> Map</button>
</div>
<div class="col-sm-3">
<button class="btn btn-success"><i class="bi bi-fullscreen"></i> Maximize</button>
</div>
<div class="col-sm-3">
<button class="btn btn-warning"><i class="bi bi-menu-button-wide-fill"></i> Menu</button>
</div>
<div class="col-sm-3">
<button class="btn btn-secondary"><i class="bi bi-envelope"></i> Message</button>
</div>
<div class="col-sm-3">
<button class="btn btn-info"><i class="bi bi-dash-circle"></i> Minus</button>
</div>
<div class="col-sm-3">
<button class="btn btn-light"><i class="bi bi-cash"></i> Money</button>
</div>
<div class="col-sm-3">
<button class="btn btn-dark"><i class="bi bi-moon"></i> Moon</button>
</div>
<div class="col-sm-3">
<button class="btn btn-primary"><i class="bi bi-music-note"></i> Music</button>
</div>
<div class="col-sm-3">
<button class="btn btn-success"><i class="bi bi-segmented-nav"></i> Navicon</button>
</div>
<div class="col-sm-3">
<button class="btn btn-danger"><i class="bi bi-paperclip"></i> Paperclip</button>
</div>
<div class="col-sm-3">
<button class="btn btn-warning"><i class="bi bi-pause"></i> Pause</button>
</div>
<div class="col-sm-3">
<button class="btn btn-secondary"><i class="bi bi-pencil"></i> Pencil</button>
</div>
<div class="col-sm-3">
<button class="btn btn-info"><i class="bi bi-phone"></i> Phone</button>
</div>
<div class="col-sm-3">
<button class="btn btn-light"><i class="bi bi-image"></i> Picture </button>
</div>
<div class="col-sm-3">
<button class="btn btn-dark"><i class="bi bi-plus"></i> Plus</button>
</div>
<div class="col-sm-3">
<button class="btn btn-primary"><i class="bi bi-power"></i> Power Off</button>
</div>
<div class="col-sm-3">
<button class="btn btn-success"><i class="bi bi-printer"></i> Print</button>
</div>
<div class="col-sm-3">
<button class="btn btn-danger"><i class="bi bi-puzzle-fill"></i> Puzzle Piece</button>
</div>
<div class="col-sm-3">
<button class="btn btn-warning"><i class="bi bi-question"></i> Question</button>
</div>
<div class="col-sm-3">
<button class="btn btn-secondary"><i class="bi bi-quote"></i> Quote Left</button>
</div>
<div class="col-sm-3">
<button class="btn btn-light"><i class="bi bi-arrow-return-left"></i> Redo</button>
</div>
<div class="col-sm-3">
<button class="btn btn-primary"><i class="bi bi-trash"></i> Remove</button>
</div>
<div class="col-sm-3">
<button class="btn btn-success"><i class="bi bi-arrow-clockwise"></i> Refresh</button>
</div>
<div class="col-sm-3">
<button class="btn btn-success"><i class="bi bi-reply"></i> Reply</button>
</div>
<div class="col-sm-3">
<button class="btn btn-danger"><i class="bi bi-twitter"></i> Retweet</button>
</div>
<div class="col-sm-3">
<button class="btn btn-warning"><i class="bi bi-search"></i> Search</button>
</div>
<div class="col-sm-3">
<button class="btn btn-secondary"><i class="bi bi-send"></i> Send</button>
</div>
<div class="col-sm-3">
<button class="btn btn-info"><i class="bi bi-gear"></i> Settings</button>
</div>
<div class="col-sm-3">
<button class="btn btn-light"><i class="bi bi-share"></i> Share</button>
</div>
<div class="col-sm-3">
<button class="btn btn-dark"><i class="bi bi-shield"></i> Shield</button>
</div>
<div class="col-sm-3">
<button class="btn btn-primary"><i class="bi bi-cart"></i> Shopping Cart</button>
</div>
<div class="col-sm-3">
<button class="btn btn-success"><i class="bi bi-signal"></i> Signal</button>
</div>
<div class="col-sm-3">
<button class="btn btn-primary"><i class="bi bi-speaker"></i> Speaker</button>
</div>
<div class="col-sm-3">
<button class="btn btn-danger"><i class="bi bi-star"></i> Star</button>
</div>
<div class="col-sm-3">
<button class="btn btn-secondary"><i class="bi bi-stopwatch"></i> Stopwatch</button>
</div>
<div class="col-sm-3">
<button class="btn btn-light"><i class="bi bi-subscript"></i> Subscript</button>
</div>
<div class="col-sm-3">
<button class="btn btn-dark"><i class="bi bi-superscript"></i> Superscript</button>
</div>
<div class="col-sm-3">
<button class="btn btn-primary"><i class="bi bi-tablet"></i> Tablet</button>
</div>
<div class="col-sm-3">
<button class="btn btn-success"><i class="bi bi-tag"></i> Tag</button>
</div>
<div class="col-sm-3">
<button class="btn btn-danger"><i class="bi bi-trash"></i> Trash</button>
</div>
</div>