ribbons.mdx 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207
  1. ---
  2. title: Ribbons
  3. summary: Ribbons are graphical elements which attract users' attention to a given element of an interface and make it stand out.
  4. description: Highlight elements with graphical ribbons.
  5. ---
  6. ## Default markup
  7. Use the `ribbon` class to add the default ribbon to any section of your interface.
  8. ```html example columns={1} centered background="base"
  9. <div class="card">
  10. <div class="card-body" style="height: 5rem"></div>
  11. <div class="ribbon">
  12. <svg
  13. xmlns="http://www.w3.org/2000/svg"
  14. class="icon"
  15. width="24"
  16. height="24"
  17. viewBox="0 0 24 24"
  18. stroke-width="2"
  19. stroke="currentColor"
  20. fill="none"
  21. stroke-linecap="round"
  22. stroke-linejoin="round"
  23. >
  24. <path stroke="none" d="M0 0h24v24H0z" fill="none" />
  25. <path
  26. d="M12 17.75l-6.172 3.245l1.179 -6.873l-5 -4.867l6.9 -1l3.086 -6.253l3.086 6.253l6.9 1l-5 4.867l1.179 6.873z"
  27. />
  28. </svg>
  29. </div>
  30. </div>
  31. ```
  32. ```html
  33. <div class="card">
  34. <div class="card-body"></div>
  35. <div class="ribbon">
  36. <!-- SVG icon from http://tabler.io/icons/icon/star -->
  37. <svg>...</svg>
  38. </div>
  39. </div>
  40. ```
  41. ## Ribbon position
  42. You can change the position of a ribbon by adding one of the following classes to the element:
  43. - `ribbon-top` - moves it to the top
  44. - `ribbon-end` - moves it to the right
  45. - `ribbon-bottom` - moves it to the bottom
  46. - `ribbon-start` - moves it to the left
  47. Using multiple classes at once will give you more position options. For example, the following class: `.ribbon.ribbon-top.ribbon-left` will move the ribbon to the top left corner.
  48. ```html example columns={1} centered background="base"
  49. <div class="card">
  50. <div class="card-body" style="height: 5rem"></div>
  51. <div class="ribbon ribbon-top ribbon-start">
  52. <svg
  53. xmlns="http://www.w3.org/2000/svg"
  54. class="icon"
  55. width="24"
  56. height="24"
  57. viewBox="0 0 24 24"
  58. stroke-width="2"
  59. stroke="currentColor"
  60. fill="none"
  61. stroke-linecap="round"
  62. stroke-linejoin="round"
  63. >
  64. <path stroke="none" d="M0 0h24v24H0z" fill="none" />
  65. <path
  66. d="M12 17.75l-6.172 3.245l1.179 -6.873l-5 -4.867l6.9 -1l3.086 -6.253l3.086 6.253l6.9 1l-5 4.867l1.179 6.873z"
  67. />
  68. </svg>
  69. </div>
  70. </div>
  71. ```
  72. ```html
  73. <div class="card">
  74. <div class="card-body"></div>
  75. <div class="ribbon ribbon-top ribbon-start">
  76. <!-- SVG icon from http://tabler.io/icons/icon/star -->
  77. <svg>...</svg>
  78. </div>
  79. </div>
  80. ```
  81. ## Ribbon color
  82. Customize the ribbon's background color. You can click [here](/docs/ui/base/colors) to see the list of available colors.
  83. ```html example columns={1} centered background="base"
  84. <div class="card">
  85. <div class="card-body" style="height: 5rem"></div>
  86. <div class="ribbon bg-red">
  87. <svg
  88. xmlns="http://www.w3.org/2000/svg"
  89. class="icon"
  90. width="24"
  91. height="24"
  92. viewBox="0 0 24 24"
  93. stroke-width="2"
  94. stroke="currentColor"
  95. fill="none"
  96. stroke-linecap="round"
  97. stroke-linejoin="round"
  98. >
  99. <path stroke="none" d="M0 0h24v24H0z" fill="none" />
  100. <path
  101. d="M12 17.75l-6.172 3.245l1.179 -6.873l-5 -4.867l6.9 -1l3.086 -6.253l3.086 6.253l6.9 1l-5 4.867l1.179 6.873z"
  102. />
  103. </svg>
  104. </div>
  105. </div>
  106. ```
  107. ```html
  108. <div class="card">
  109. <div class="card-body"></div>
  110. <div class="ribbon bg-red">
  111. <!-- SVG icon from http://tabler.io/icons/icon/star -->
  112. <svg>...</svg>
  113. </div>
  114. </div>
  115. ```
  116. ## Ribbon text
  117. Add your own text to a ribbon to display any additional information and make it easy to spot for users.
  118. ```html example columns={1} centered background="base"
  119. <div class="card">
  120. <div class="card-body" style="height: 5rem"></div>
  121. <div class="ribbon bg-green">
  122. <svg
  123. xmlns="http://www.w3.org/2000/svg"
  124. class="icon"
  125. width="24"
  126. height="24"
  127. viewBox="0 0 24 24"
  128. stroke-width="2"
  129. stroke="currentColor"
  130. fill="none"
  131. stroke-linecap="round"
  132. stroke-linejoin="round"
  133. >
  134. <path stroke="none" d="M0 0h24v24H0z" fill="none" />
  135. <path
  136. d="M12 17.75l-6.172 3.245l1.179 -6.873l-5 -4.867l6.9 -1l3.086 -6.253l3.086 6.253l6.9 1l-5 4.867l1.179 6.873z"
  137. />
  138. </svg>
  139. </div>
  140. </div>
  141. ```
  142. ```html
  143. <div class="card">
  144. <div class="card-body"></div>
  145. <div class="ribbon bg-green">
  146. <!-- SVG icon from http://tabler.io/icons/icon/star -->
  147. <svg>...</svg>
  148. </div>
  149. </div>
  150. ```
  151. ## Ribbon style
  152. Change the style of a ribbon to make it go well with your interface design.
  153. ```html example columns={1} centered background="base"
  154. <div class="card w-100">
  155. <div class="card-body" style="height: 5rem"></div>
  156. <div class="ribbon ribbon-bookmark bg-orange">
  157. <svg
  158. xmlns="http://www.w3.org/2000/svg"
  159. class="icon"
  160. width="24"
  161. height="24"
  162. viewBox="0 0 24 24"
  163. stroke-width="2"
  164. stroke="currentColor"
  165. fill="none"
  166. stroke-linecap="round"
  167. stroke-linejoin="round"
  168. >
  169. <path stroke="none" d="M0 0h24v24H0z" fill="none" />
  170. <path
  171. d="M12 17.75l-6.172 3.245l1.179 -6.873l-5 -4.867l6.9 -1l3.086 -6.253l3.086 6.253l6.9 1l-5 4.867l1.179 6.873z"
  172. />
  173. </svg>
  174. </div>
  175. </div>
  176. ```
  177. ```html
  178. <div class="card">
  179. <div class="card-body"></div>
  180. <div class="ribbon ribbon-bookmark bg-orange">
  181. <!-- SVG icon from http://tabler.io/icons/icon/star -->
  182. <svg>...</svg>
  183. </div>
  184. </div>
  185. ```