breadcrumb.mdx 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. ---
  2. title: Breadcrumb
  3. description: 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. ---
  6. ## Default markup
  7. Add the `:before` pseudo-element in `li` tags to use the default separators. The `active` modifier in a `li` tag will help you indicate the current page location and facilitate navigation within your website or app.
  8. ```html code example centered
  9. <ol class="breadcrumb" aria-label="breadcrumbs">
  10. <li class="breadcrumb-item"><a href="#">Home</a></li>
  11. <li class="breadcrumb-item"><a href="#">Library</a></li>
  12. <li class="breadcrumb-item active" aria-current="page"><a href="#">Data</a></li>
  13. </ol>
  14. ```
  15. ## Breadcrumb variations
  16. If you wish to use different separators, modify the `$breadcrumb-variants` variable in the Tabler config. Depending on the aesthetics of your design, you can choose dots, bullets or arrows.
  17. ```html code example centered
  18. <ol class="breadcrumb breadcrumb-dots" aria-label="breadcrumbs">
  19. <li class="breadcrumb-item"><a href="#">Home</a></li>
  20. <li class="breadcrumb-item"><a href="#">Library</a></li>
  21. <li class="breadcrumb-item active" aria-current="page"><a href="#">Data</a></li>
  22. </ol>
  23. ```
  24. ```html code example centered
  25. <ol class="breadcrumb breadcrumb-arrows" aria-label="breadcrumbs">
  26. <li class="breadcrumb-item"><a href="#">Home</a></li>
  27. <li class="breadcrumb-item"><a href="#">Library</a></li>
  28. <li class="breadcrumb-item active" aria-current="page"><a href="#">Data</a></li>
  29. </ol>
  30. ```
  31. ```html code example centered
  32. <ol class="breadcrumb breadcrumb-bullets" aria-label="breadcrumbs">
  33. <li class="breadcrumb-item"><a href="#">Home</a></li>
  34. <li class="breadcrumb-item"><a href="#">Library</a></li>
  35. <li class="breadcrumb-item active" aria-current="page"><a href="#">Data</a></li>
  36. </ol>
  37. ```
  38. ## Breadcrumb in headers
  39. If you wish to use breadcrumbs in headers, place them above the headers.
  40. ```html example vertical centered columns={3}
  41. <div class="page-header">
  42. <div class="row align-items-center mw-100">
  43. <div class="col">
  44. <div class="mb-1">
  45. <ol class="breadcrumb" aria-label="breadcrumbs">
  46. <li class="breadcrumb-item"><a href="#">Home</a></li>
  47. <li class="breadcrumb-item"><a href="#">Library</a></li>
  48. <li class="breadcrumb-item active" aria-current="page"><a href="#">Articles</a></li>
  49. </ol>
  50. </div>
  51. <h2 class="page-title">
  52. <span class="text-truncate">Knights of Ni, we are but simple travelers who seek the enchanter who lives beyond these woods.</span>
  53. </h2>
  54. </div>
  55. <div class="col-auto">
  56. <div class="btn-list">
  57. <a href="#" class="btn d-none d-md-inline-flex"><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">
  58. <path stroke="none" d="M0 0h24v24H0z" fill="none" />
  59. <path d="M7 7h-1a2 2 0 0 0 -2 2v9a2 2 0 0 0 2 2h9a2 2 0 0 0 2 -2v-1" />
  60. <path d="M20.385 6.585a2.1 2.1 0 0 0 -2.97 -2.97l-8.415 8.385v3h3l8.385 -8.415z" />
  61. <path d="M16 5l3 3" />
  62. </svg> Edit</a>
  63. <a href="#" class="btn btn-primary">Publish</a>
  64. </div>
  65. </div>
  66. </div>
  67. </div>
  68. ```
  69. ```html
  70. <div class="page-header">
  71. <div class="row align-items-center mw-100">
  72. <div class="col">
  73. <div class="mb-1">
  74. <ol class="breadcrumb" aria-label="breadcrumbs">
  75. <li class="breadcrumb-item"><a href="#">Home</a></li>
  76. <li class="breadcrumb-item"><a href="#">Library</a></li>
  77. <li class="breadcrumb-item active" aria-current="page"><a href="#">Articles</a></li>
  78. </ol>
  79. </div>
  80. <h2 class="page-title">
  81. <span class="text-truncate">Knights of Ni, we are but simple travelers who seek the enchanter who lives beyond these woods.</span>
  82. </h2>
  83. </div>
  84. <div class="col-auto">
  85. <div class="btn-list">
  86. <a href="#" class="btn d-none d-md-inline-flex">
  87. <!-- SVG icon from http://tabler-icons.io/i/edit -->
  88. <svg>...</svg> Edit
  89. </a>
  90. <a href="#" class="btn btn-primary">Publish</a>
  91. </div>
  92. </div>
  93. </div>
  94. </div>
  95. ```