page-layouts.mdx 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208
  1. ---
  2. title: Page layouts
  3. summary: Learn how to build a sample version of the dashboard
  4. description: Learn to design dashboard layouts.
  5. ---
  6. <Callout>
  7. Before you start with this section, make sure you have followed the [installation guideline](/docs/ui/getting-started/installation).
  8. </Callout>
  9. ## Sample layout
  10. To create a sample version of the dashboard, you can use the following code snippet. This code snippet will help you to create a dashboard layout with a header.
  11. ```html example fullpage resizable height="30rem"
  12. <div class="page">
  13. <header class="navbar navbar-expand-sm navbar-light d-print-none">
  14. <div class="container-xl">
  15. <h1 class="navbar-brand navbar-brand-autodark d-none-navbar-horizontal pe-0 pe-md-3">
  16. <a href="#">
  17. <img src="https://preview.tabler.io/static/logo.svg" width="110" height="32" alt="Tabler" class="navbar-brand-image" />
  18. </a>
  19. </h1>
  20. <div class="navbar-nav flex-row order-md-last">
  21. <div class="nav-item">
  22. <a href="#" class="nav-link d-flex lh-1 text-reset p-0">
  23. <span class="avatar avatar-sm" style="background-image: url(/samples/avatars/002m.jpg)"></span>
  24. <div class="d-none d-xl-block ps-2">
  25. <div>Paweł Kuna</div>
  26. <div class="mt-1 small text-secondary">UI Designer</div>
  27. </div>
  28. </a>
  29. </div>
  30. </div>
  31. </div>
  32. </header>
  33. <div class="page-wrapper">
  34. <div class="page-body">
  35. <div class="container-xl">
  36. <div class="row row-deck row-cards">
  37. <div class="col-4">
  38. <div class="card">
  39. <div class="card-body" style="height: 10rem"></div>
  40. </div>
  41. </div>
  42. <div class="col-4">
  43. <div class="card">
  44. <div class="card-body" style="height: 10rem"></div>
  45. </div>
  46. </div>
  47. <div class="col-4">
  48. <div class="card">
  49. <div class="card-body" style="height: 10rem"></div>
  50. </div>
  51. </div>
  52. <div class="col-12">
  53. <div class="card">
  54. <div class="card-body" style="height: 10rem"></div>
  55. </div>
  56. </div>
  57. </div>
  58. </div>
  59. </div>
  60. </div>
  61. </div>
  62. ```
  63. ## Sidebar layout
  64. To create a sidebar layout, you can use the following code snippet. This code snippet will help you to create a sidebar layout with a header.
  65. ```html example fullpage resizable height="30rem"
  66. <div class="page">
  67. <!-- Sidebar -->
  68. <aside class="navbar navbar-vertical navbar-expand-sm" data-bs-theme="dark">
  69. <div class="container-fluid">
  70. <button class="navbar-toggler" type="button">
  71. <span class="navbar-toggler-icon"></span>
  72. </button>
  73. <h1 class="navbar-brand navbar-brand-autodark">
  74. <a href="#">
  75. <img src="https://preview.tabler.io/static/logo-white.svg" width="110" height="32" alt="Tabler" class="navbar-brand-image">
  76. </a>
  77. </h1>
  78. <div class="collapse navbar-collapse" id="sidebar-menu">
  79. <ul class="navbar-nav pt-lg-3">
  80. <li class="nav-item">
  81. <a class="nav-link" href="./">
  82. <span class="nav-link-title">
  83. Home
  84. </span>
  85. </a>
  86. </li>
  87. <li class="nav-item">
  88. <a class="nav-link" href="#">
  89. <span class="nav-link-title">
  90. Link 1
  91. </span>
  92. </a>
  93. </li>
  94. <li class="nav-item">
  95. <a class="nav-link" href="#">
  96. <span class="nav-link-title">
  97. Link 2
  98. </span>
  99. </a>
  100. </li>
  101. <li class="nav-item">
  102. <a class="nav-link" href="#">
  103. <span class="nav-link-title">
  104. Link 3
  105. </span>
  106. </a>
  107. </li>
  108. </ul>
  109. </div>
  110. </div>
  111. </aside>
  112. <div class="page-wrapper">
  113. <div class="page-header d-print-none">
  114. <div class="container-xl">
  115. <div class="row g-2 align-items-center">
  116. <div class="col">
  117. <h2 class="page-title">
  118. Vertical layout
  119. </h2>
  120. </div>
  121. </div>
  122. </div>
  123. </div>
  124. <div class="page-body">
  125. <div class="container-xl">
  126. <div class="row row-deck row-cards">
  127. <div class="col-sm-6 col-lg-3">
  128. <div class="card">
  129. <div class="card-body" style="height: 10rem"></div>
  130. </div>
  131. </div>
  132. <div class="col-sm-6 col-lg-3">
  133. <div class="card">
  134. <div class="card-body" style="height: 10rem"></div>
  135. </div>
  136. </div>
  137. <div class="col-sm-6 col-lg-3">
  138. <div class="card">
  139. <div class="card-body" style="height: 10rem"></div>
  140. </div>
  141. </div>
  142. <div class="col-sm-6 col-lg-3">
  143. <div class="card">
  144. <div class="card-body" style="height: 10rem"></div>
  145. </div>
  146. </div>
  147. <div class="col-lg-6">
  148. <div class="row row-cards">
  149. <div class="col-12">
  150. <div class="card">
  151. <div class="card-body" style="height: 10rem"></div>
  152. </div>
  153. </div>
  154. <div class="col-12">
  155. <div class="card">
  156. <div class="card-body" style="height: 10rem"></div>
  157. </div>
  158. </div>
  159. </div>
  160. </div>
  161. <div class="col-lg-6">
  162. <div class="card">
  163. <div class="card-body" style="height: 10rem"></div>
  164. </div>
  165. </div>
  166. <div class="col-12">
  167. <div class="card">
  168. <div class="card-body" style="height: 10rem"></div>
  169. </div>
  170. </div>
  171. <div class="col-md-12 col-lg-8">
  172. <div class="card">
  173. <div class="card-body" style="height: 10rem"></div>
  174. </div>
  175. </div>
  176. <div class="col-md-6 col-lg-4">
  177. <div class="card">
  178. <div class="card-body" style="height: 10rem"></div>
  179. </div>
  180. </div>
  181. <div class="col-md-6 col-lg-4">
  182. <div class="card">
  183. <div class="card-body" style="height: 10rem"></div>
  184. </div>
  185. </div>
  186. <div class="col-md-12 col-lg-8">
  187. <div class="card">
  188. <div class="card-body" style="height: 10rem"></div>
  189. </div>
  190. </div>
  191. <div class="col-12">
  192. <div class="card">
  193. <div class="card-body" style="height: 10rem"></div>
  194. </div>
  195. </div>
  196. </div>
  197. </div>
  198. </div>
  199. </div>
  200. </div>
  201. ```