steps.mdx 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  1. ---
  2. title: Steps
  3. summary: Steps are used to guide users through complex processes, making them easier and more intuitive. Breaking a multi-step process into smaller parts and tracking progress along the way helps users complete it successfully.
  4. new: true
  5. description: Simplify complex processes with steps.
  6. ---
  7. ## Default markup
  8. Steps provide a clear visual representation of a user’s progress through a multi-step process. By showing what has been completed and what remains, steps enhance usability and encourage task completion.
  9. To create a default progress tracker, use the `.steps` class and define each step as a `.step-item`. The active step clearly indicates the current position in the process.
  10. ```html
  11. <div class="steps">
  12. <a href="#" class="step-item"> Step 1 </a>
  13. <a href="#" class="step-item"> Step 2 </a>
  14. <a href="#" class="step-item active"> Step 3 </a>
  15. </div>
  16. ```
  17. The example below demonstrates a simple progress tracker with four steps, where the third step is active.
  18. ```html example centered
  19. <div class="steps">
  20. <a href="#" class="step-item"> Step 1 </a>
  21. <a href="#" class="step-item"> Step 2 </a>
  22. <a href="#" class="step-item active"> Step 3 </a>
  23. <span href="#" class="step-item"> Step 4 </span>
  24. </div>
  25. ```
  26. ## Tooltips
  27. Add tooltips if you want to provide users with additional information about the steps they are expected to complete. Tooltips are displayed when a user hovers over a given step and help clarify what might not be clear from the interface.
  28. To add a tooltip, use the `data-bs-toggle="tooltip"` attribute and specify the tooltip content with the `title` attribute.
  29. ```html
  30. <a
  31. href="#"
  32. class="step-item"
  33. data-bs-toggle="tooltip"
  34. data-bs-placement="top"
  35. title="Step 1 description"
  36. >
  37. Step 1
  38. </a>
  39. ```
  40. The example below demonstrates a progress tracker with tooltips for each step.
  41. ```html example centered height="20rem"
  42. <div class="steps">
  43. <a
  44. href="#"
  45. class="step-item"
  46. data-bs-toggle="tooltip"
  47. data-bs-placement="top"
  48. title="Step 1 description"
  49. >
  50. Step 1
  51. </a>
  52. <a
  53. href="#"
  54. class="step-item"
  55. data-bs-toggle="tooltip"
  56. data-bs-placement="top"
  57. title="Step 2 description"
  58. >
  59. Step 2
  60. </a>
  61. <a
  62. href="#"
  63. class="step-item active"
  64. data-bs-toggle="tooltip"
  65. data-bs-placement="top"
  66. title="Step 3 description"
  67. >
  68. Step 3
  69. </a>
  70. <span
  71. href="#"
  72. class="step-item"
  73. data-bs-toggle="tooltip"
  74. data-bs-placement="top"
  75. title="Step 4 description"
  76. >
  77. Step 4
  78. </span>
  79. </div>
  80. ```
  81. ## Color
  82. You can customize the default progress indicator by changing the color to one that better suits your design. Click [here](/docs/ui/base/colors) to see the range of available colors.
  83. ```html
  84. <div class="steps steps-green">...</div>
  85. ```
  86. The example below demonstrates a progress tracker with two different color schemes.
  87. ```html example centered
  88. <div class="steps steps-green">
  89. <a href="#" class="step-item"> Step 1 </a>
  90. <a href="#" class="step-item"> Step 2 </a>
  91. <a href="#" class="step-item active"> Step 3 </a>
  92. <span href="#" class="step-item"> Step 4 </span>
  93. </div>
  94. <div class="steps steps-red">
  95. <a href="#" class="step-item"> Step 1 </a>
  96. <a href="#" class="step-item"> Step 2 </a>
  97. <a href="#" class="step-item active"> Step 3 </a>
  98. <span href="#" class="step-item"> Step 4 </span>
  99. </div>
  100. ```
  101. ## Steps without title
  102. For designs with limited space, use progress indicators without titles and add tooltips to provide the necessary details.
  103. ```html example centered
  104. <div class="steps">
  105. <a
  106. href="#"
  107. class="step-item"
  108. data-bs-toggle="tooltip"
  109. data-bs-placement="top"
  110. title="Step 1 description"
  111. ></a>
  112. <a
  113. href="#"
  114. class="step-item"
  115. data-bs-toggle="tooltip"
  116. data-bs-placement="top"
  117. title="Step 2 description"
  118. ></a>
  119. <a
  120. href="#"
  121. class="step-item active"
  122. data-bs-toggle="tooltip"
  123. data-bs-placement="top"
  124. title="Step 3 description"
  125. ></a>
  126. <span
  127. href="#"
  128. class="step-item"
  129. data-bs-toggle="tooltip"
  130. data-bs-placement="top"
  131. title="Step 4 description"
  132. ></span>
  133. </div>
  134. ```
  135. ## Steps with numbers
  136. Use the `steps-counter` class to create a progress tracker with numbers instead of titles and change the color to customize it.
  137. ```html
  138. <div class="steps steps-counter">...</div>
  139. ```
  140. The example below demonstrates a progress tracker with numbers and a different color scheme.
  141. ```html example centered
  142. <div class="steps steps-counter">
  143. <a href="#" class="step-item"></a>
  144. <a href="#" class="step-item active"></a>
  145. <span href="#" class="step-item"></span>
  146. <span href="#" class="step-item"></span>
  147. <span href="#" class="step-item"></span>
  148. </div>
  149. ```