ribbons.mdx 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  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">
  11. </div>
  12. <div class="ribbon">
  13. <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">
  14. <path stroke="none" d="M0 0h24v24H0z" fill="none" />
  15. <path 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" />
  16. </svg>
  17. </div>
  18. </div>
  19. ```
  20. ```html
  21. <div class="card">
  22. <div class="card-body">
  23. </div>
  24. <div class="ribbon">
  25. <!-- SVG icon from http://tabler.io/icons/icon/star -->
  26. <svg>...</svg>
  27. </div>
  28. </div>
  29. ```
  30. ## Ribbon position
  31. You can change the position of a ribbon by adding one of the following classes to the element:
  32. - `ribbon-top` - moves it to the top
  33. - `ribbon-end` - moves it to the right
  34. - `ribbon-bottom` - moves it to the bottom
  35. - `ribbon-start` - moves it to the left
  36. 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.
  37. ```html example columns={1} centered background="base"
  38. <div class="card">
  39. <div class="card-body" style="height: 5rem">
  40. </div>
  41. <div class="ribbon ribbon-top ribbon-start">
  42. <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">
  43. <path stroke="none" d="M0 0h24v24H0z" fill="none" />
  44. <path 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" />
  45. </svg>
  46. </div>
  47. </div>
  48. ```
  49. ```html
  50. <div class="card">
  51. <div class="card-body">
  52. </div>
  53. <div class="ribbon ribbon-top ribbon-start">
  54. <!-- SVG icon from http://tabler.io/icons/icon/star -->
  55. <svg>...</svg>
  56. </div>
  57. </div>
  58. ```
  59. ## Ribbon color
  60. Customize the ribbon's background color. You can click [here](/docs/ui/base/colors) to see the list of available colors.
  61. ```html example columns={1} centered background="base"
  62. <div class="card">
  63. <div class="card-body" style="height: 5rem">
  64. </div>
  65. <div class="ribbon bg-red">
  66. <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">
  67. <path stroke="none" d="M0 0h24v24H0z" fill="none" />
  68. <path 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" />
  69. </svg>
  70. </div>
  71. </div>
  72. ```
  73. ```html
  74. <div class="card">
  75. <div class="card-body">
  76. </div>
  77. <div class="ribbon bg-red">
  78. <!-- SVG icon from http://tabler.io/icons/icon/star -->
  79. <svg>...</svg>
  80. </div>
  81. </div>
  82. ```
  83. ## Ribbon text
  84. Add your own text to a ribbon to display any additional information and make it easy to spot for users.
  85. ```html example columns={1} centered background="base"
  86. <div class="card">
  87. <div class="card-body" style="height: 5rem">
  88. </div>
  89. <div class="ribbon bg-green">
  90. <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">
  91. <path stroke="none" d="M0 0h24v24H0z" fill="none" />
  92. <path 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" />
  93. </svg>
  94. </div>
  95. </div>
  96. ```
  97. ```html
  98. <div class="card">
  99. <div class="card-body">
  100. </div>
  101. <div class="ribbon bg-green">
  102. <!-- SVG icon from http://tabler.io/icons/icon/star -->
  103. <svg>...</svg>
  104. </div>
  105. </div>
  106. ```
  107. ## Ribbon style
  108. Change the style of a ribbon to make it go well with your interface design.
  109. ```html example columns={1} centered background="base"
  110. <div class="card w-100">
  111. <div class="card-body" style="height: 5rem">
  112. </div>
  113. <div class="ribbon ribbon-bookmark bg-orange">
  114. <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">
  115. <path stroke="none" d="M0 0h24v24H0z" fill="none" />
  116. <path 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" />
  117. </svg>
  118. </div>
  119. </div>
  120. ```
  121. ```html
  122. <div class="card">
  123. <div class="card-body">
  124. </div>
  125. <div class="ribbon ribbon-bookmark bg-orange">
  126. <!-- SVG icon from http://tabler.io/icons/icon/star -->
  127. <svg>...</svg>
  128. </div>
  129. </div>
  130. ```