In this guide, we will discuss Breadcrumb in Bulma.
Description
The .breadcrumb class is required to define the breadcrumb component and the .is-active class can be used to show a particular active page.
The default .breadcrumb class is aligned to left. You can align the breadcrumb container by combining .breadcrumb class with is-centered class for center alignment and with is-right class for right alignment.
The below example describes how to display breadcrumb (using breadcrumb class in the nav tag) and alignment for the elements in the page −
<!DOCTYPE html> <html> <head> <meta charset = "utf-8"> <meta name = "viewport" content = "width = device-width, initial-scale = 1"> <title>Card</title> <link rel = "stylesheet" href = "https://cdnjs.cloudflare.com/ajax/libs/bulma/0.7.1/css/bulma.min.css"> <script defer src = "https://use.fontawesome.com/releases/v5.1.0/js/all.js"></script> <script defer src = "https://use.fontawesome.com/releases/v5.1.0/js/all.js"></script> </head> <body> <section class = "section"> <div class = "container"> <h1 class = "is-size-2">Breadcrumb</h1> <nav class = "breadcrumb is-small" aria-label = "breadcrumbs"> <ul> <li><a href = "#">Bulma</a></li> <li><a href = "#">Documentation</a></li> <li><a href = "#">Components</a></li> <li class = "is-active"><a href = "#" aria-current = "page">Breadcrumb</a></li> </ul> </nav> <br> <!-- <p class = "is-size-3">Alignment </p> <br> --> <h1 class = "is-size-3">Alignment</h1> <br> <h1 class = "is-size-5">Center</h1> <nav class = "breadcrumb is-centered" aria-label = "breadcrumbs"> <ul> <li><a href = "#">Bulma</a></li> <li><a href = "#">Documentation</a></li> <li><a href = "#">Components</a></li> <li class = "is-active"> <a href = "#" aria-current = "page">Breadcrumb</a> </li> </ul> </nav> <br> <h1 class = "is-size-5">Right</h1> <nav class = "breadcrumb is-right" aria-label =" breadcrumbs"> <ul> <li><a href = "#">Bulma</a></li> <li><a href = "#">Documentation</a></li> <li><a href = "#">Components</a></li> <li class = "is-active"> <a href = "#" aria-current = "page">Breadcrumb</a> </li> </ul> </nav> </div> </section> </body> </html>
Icons
The .breadcrumb class can be used with Font Awesome icons and can also be combined with additional separator classes such as has-arrow-separator, has-bullet-separator, has-dot-separator, has-succeeds-separator classes.
The below example demonstrates use of the icons and above additional separator classes, along with .breadcrumb class container −
<!DOCTYPE html> <html> <head> <meta charset = "utf-8"> <meta name = "viewport" content = "width = device-width, initial-scale = 1"> <title>Breadcrumb - Icons</title> <link rel = "stylesheet" href = "https://cdnjs.cloudflare.com/ajax/libs/bulma/0.7.1/css/bulma.min.css"> <script defer src = "https://use.fontawesome.com/releases/v5.1.0/js/all.js"></script> <script defer src = "https://use.fontawesome.com/releases/v5.1.0/js/all.js"></script> </head> <body> <section class = "section"> <div class = "container"> <p class = "is-size-4">Breadcrumb with Icons</p> <nav class = "breadcrumb" aria-label = "breadcrumbs"> <ul> <li> <a href = "#"> <span class = "icon is-small"> <i class = "fas fa-home" aria-hidden = "true"></i> </span> <span>Home</span> </a> </li> <li> <a href = "#"> <span class = "icon is-small"> <i class = "fas fa-book" aria-hidden = "true"></i> </span> <span>Adglob</span> </a> </li> <li> <a href = "#"> <span class = "icon is-small"> <i class = "fas fa-puzzle-piece" aria-hidden = "true"></i> </span> <span>Bulma</span> </a> </li> <li class = "is-active"> <a href = "#"> <span class = "icon is-small"> <i class = "fas fa-thumbs-up" aria-hidden = "true"></i> </span> <span>Documentation</span> </a> </li> </ul> </nav> <p class = "is-size-4">Different types of Breadcrumbs</p> <br> <nav class = "breadcrumb has-arrow-separator" aria-label = "breadcrumbs"> <ul> <li><a href = "#">Home</a></li> <li><a href = "#">Adglob</a></li> <li><a href = "#">Bulma</a></li> <li class = "is-active"> <a href = "#" aria-current = "page">Documentation</a> </li> </ul> </nav> <br> <nav class = "breadcrumb has-bullet-separator" aria-label = "breadcrumbs"> <ul> <li><a href = "#">Home</a></li> <li><a href = "#">Adglob</a></li> <li><a href = "#">Bulma</a></li> <li class = "is-active"> <a href = "#" aria-current = "page">Documentation</a> </li> </ul> </nav> <br> <nav class = "breadcrumb has-dot-separator" aria-label = "breadcrumbs"> <ul> <li><a href = "#">Home</a></li> <li><a href = "#">Adglob</a></li> <li><a href = "#">Bulma</a></li> <li class = "is-active"> <a href = "#" aria-current="page">Documentation</a> </li> </ul> </nav> <br> <nav class = "breadcrumb has-succeeds-separator" aria-label = "breadcrumbs"> <ul> <li><a href = "#">Home</a></li> <li><a href = "#">Adglob</a></li> <li><a href = "#">Bulma</a></li> <li class = "is-active"> <a href = "#" aria-current = "page">Documentation</a> </li> </ul> </nav> </div> </section> </body> </html>
Sizes
The .breadcrumb class can be combined with 3 types of size classes such as is-small, is-medium and is-large.
The below example shows sizes of breadcrumb in the page −
<!DOCTYPE html> <html> <head> <meta charset = "utf-8"> <meta name = "viewport" content = "width = device-width, initial-scale = 1"> <title>Breadcrumb - Sizes</title> <link rel = "stylesheet" href = "https://cdnjs.cloudflare.com/ajax/libs/bulma/0.7.1/css/bulma.min.css"> <script defer src = "https://use.fontawesome.com/releases/v5.1.0/js/all.js"></script> <script defer src = "https://use.fontawesome.com/releases/v5.1.0/js/all.js"></script> </head> <body> <section class = "section"> <div class = "container"> <h1 class = "is-size-2">Breadcrumb Sizes</h1> <br> <p class = "is-size-5">Small</p> <nav class = "breadcrumb is-small" aria-label = "breadcrumbs"> <ul> <li><a href = "#">Home</a></li> <li><a href = "#">Adglob</a></li> <li><a href = "#">Bulma</a></li> <li class = "is-active"> <a href = "#" aria-current="page">Documentation</a> </li> </ul> </nav> <!-- <p class = "is-size-3">Alignment</p><br> --> <p class = "is-size-5">Medium</p> <br> <nav class = "breadcrumb is-medium" aria-label = "breadcrumbs"> <ul> <li><a href = "#">Home</a></li> <li><a href = "#">Adglob</a></li> <li><a href = "#">Bulma</a></li> <li class = "is-active"> <a href = "#" aria-current = "page">Documentation</a> </li> </ul> </nav> <p class = "is-size-5">Large</p> <br> <nav class = "breadcrumb is-large" aria-label = "breadcrumbs"> <ul> <li><a href = "#">Home</a></li> <li><a href = "#">Adglob</a></li> <li><a href = "#">Bulma</a></li> <li class = "is-active"> <a href = "#" aria-current = "page">Documentation</a> </li> </ul> </nav> </div> </section> </body> </html>
Next Topic : Click Here
Pingback: Bulma - Components | Adglob Infosystem Pvt Ltd
Pingback: Bulma - Tabs | Adglob Infosystem Pvt Ltd