breadcrumb.mdx 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  1. ---
  2. title: Breadcrumb
  3. summary: Breadcrumbs are used to show the current website or app location and reduce the number of actions users have to take. Thanks to breadcrumbs, they can easily navigate within the website hierarchy and better understand its structure.
  4. bootstrapLink: components/breadcrumb/
  5. description: Navigation aid for better structure.
  6. ---
  7. ## Default markup
  8. Use the `breadcrumb` class to add a breadcrumb to your interface design for better navigation. The `active` modifier in a `li` tag will help you indicate the current page location and facilitate navigation within your website or app.
  9. ```html
  10. <ol class="breadcrumb">
  11. <li class="breadcrumb-item">
  12. <a href="#">...</a>
  13. </li>
  14. <li class="breadcrumb-item active">
  15. <a href="#">...</a>
  16. </li>
  17. </ol>
  18. ```
  19. Look at the example below to see how breadcrumbs work in practice.
  20. ```html example centered
  21. <ol class="breadcrumb">
  22. <li class="breadcrumb-item">
  23. <a href="#">Home</a>
  24. </li>
  25. <li class="breadcrumb-item">
  26. <a href="#">Library</a>
  27. </li>
  28. <li class="breadcrumb-item active">
  29. <a href="#">Data</a>
  30. </li>
  31. </ol>
  32. ```
  33. ## Different separators
  34. You can use different breadcrumb styles to match your website or app design. Choose between `breadcrumb-dots`, `breadcrumb-arrows`, and `breadcrumb-bullets` to create a unique look.
  35. ```html
  36. <ol class="breadcrumb breadcrumb-dots">
  37. ...
  38. </ol>
  39. ```
  40. This example shows how to use different breadcrumb styles.
  41. ```html example centered separated vertical
  42. <ol class="breadcrumb breadcrumb-dots">
  43. <li class="breadcrumb-item">
  44. <a href="#">Home</a>
  45. </li>
  46. <li class="breadcrumb-item">
  47. <a href="#">Library</a>
  48. </li>
  49. <li class="breadcrumb-item active">
  50. <a href="#">Data</a>
  51. </li>
  52. </ol>
  53. <ol class="breadcrumb breadcrumb-arrows">
  54. <li class="breadcrumb-item">
  55. <a href="#">Home</a>
  56. </li>
  57. <li class="breadcrumb-item">
  58. <a href="#">Library</a>
  59. </li>
  60. <li class="breadcrumb-item active">
  61. <a href="#">Data</a>
  62. </li>
  63. </ol>
  64. <ol class="breadcrumb breadcrumb-bullets">
  65. <li class="breadcrumb-item">
  66. <a href="#">Home</a>
  67. </li>
  68. <li class="breadcrumb-item">
  69. <a href="#">Library</a>
  70. </li>
  71. <li class="breadcrumb-item active">
  72. <a href="#">Data</a>
  73. </li>
  74. </ol>
  75. ```
  76. ## With icon
  77. You can use icons in breadcrumbs to make them more visually appealing. The example below demonstrates how to use icons in breadcrumbs.
  78. ```html example centered
  79. <ol class="breadcrumb">
  80. <li class="breadcrumb-item">
  81. <a href="#">
  82. <svg xmlns="http://www.w3.org/2000/svg" class="icon" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">
  83. <path stroke="none" d="M0 0h24v24H0z" fill="none" />
  84. <polyline points="5 12 3 12 12 3 21 12 19 12" />
  85. <path d="M5 12v8a2 2 0 0 0 2 2h10a2 2 0 0 0 2 -2v-8" />
  86. <rect x="10" y="12" width="4" height="4" />
  87. </svg>
  88. </a>
  89. </li>
  90. <li class="breadcrumb-item">
  91. <a href="#">Library</a>
  92. </li>
  93. <li class="breadcrumb-item active">
  94. <a href="#">Data</a>
  95. </li>
  96. </ol>
  97. ```
  98. ## Muted breadcrumbs
  99. You can use the `breadcrumb-muted` class to create a muted breadcrumb style. This style is perfect for breadcrumbs that are not the main focus of your website or app.
  100. ```html example centered
  101. <nav aria-label="breadcrumb">
  102. <ol class="breadcrumb breadcrumb-muted">
  103. <li class="breadcrumb-item">
  104. <a href="#">Home</a>
  105. </li>
  106. <li class="breadcrumb-item">
  107. <a href="#">Library</a>
  108. </li>
  109. <li class="breadcrumb-item active">
  110. <a href="#">Data</a>
  111. </li>
  112. </ol>
  113. </nav>
  114. ```
  115. ## Breadcrumb in headers
  116. You can use breadcrumbs in headers to show the current page location and provide a better navigation experience. The example below demonstrates how to use breadcrumbs in headers.
  117. ```html example vertical centered columns={3}
  118. <div class="page-header">
  119. <div class="row align-items-center mw-100">
  120. <div class="col">
  121. <div class="mb-1">
  122. <ol class="breadcrumb">
  123. <li class="breadcrumb-item">
  124. <a href="#">Home</a>
  125. </li>
  126. <li class="breadcrumb-item">
  127. <a href="#">Library</a>
  128. </li>
  129. <li class="breadcrumb-item active">
  130. <a href="#">Articles</a>
  131. </li>
  132. </ol>
  133. </div>
  134. <h2 class="page-title">
  135. <span class="text-truncate">Knights of Ni, we are but simple travelers who seek the enchanter who lives beyond these woods.</span>
  136. </h2>
  137. </div>
  138. <div class="col-auto">
  139. <div class="btn-list">
  140. <a href="#" class="btn d-none d-md-inline-flex">
  141. <svg xmlns="http://www.w3.org/2000/svg" class="icon" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">
  142. <path stroke="none" d="M0 0h24v24H0z" fill="none" />
  143. <path d="M7 7h-1a2 2 0 0 0 -2 2v9a2 2 0 0 0 2 2h9a2 2 0 0 0 2 -2v-1" />
  144. <path d="M20.385 6.585a2.1 2.1 0 0 0 -2.97 -2.97l-8.415 8.385v3h3l8.385 -8.415z" />
  145. <path d="M16 5l3 3" />
  146. </svg> Edit
  147. </a>
  148. <a href="#" class="btn btn-primary">Publish</a>
  149. </div>
  150. </div>
  151. </div>
  152. </div>
  153. ```