datagrid.mdx 3.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. ---
  2. title: Data grid
  3. summary: Use the data grid component to display detailed information about your product. The data is displayed as a column of items consisting of a title and content.
  4. description: Detailed product information in grids.
  5. ---
  6. ```html example vcentered height="460px"
  7. <div class="datagrid">
  8. <div class="datagrid-item">
  9. <div class="datagrid-title">Registrar</div>
  10. <div class="datagrid-content">Third Party</div>
  11. </div>
  12. <div class="datagrid-item">
  13. <div class="datagrid-title">Nameservers</div>
  14. <div class="datagrid-content">Third Party</div>
  15. </div>
  16. <div class="datagrid-item">
  17. <div class="datagrid-title">Port number</div>
  18. <div class="datagrid-content">3306</div>
  19. </div>
  20. <div class="datagrid-item">
  21. <div class="datagrid-title">Expiration date</div>
  22. <div class="datagrid-content">–</div>
  23. </div>
  24. <div class="datagrid-item">
  25. <div class="datagrid-title">Creator</div>
  26. <div class="datagrid-content">
  27. <div class="d-flex align-items-center">
  28. <span class="avatar avatar-xs me-2 rounded" style="background-image: url(/samples/avatars/027m.jpg)"></span>
  29. Paweł Kuna
  30. </div>
  31. </div>
  32. </div>
  33. <div class="datagrid-item">
  34. <div class="datagrid-title">Age</div>
  35. <div class="datagrid-content">15 days</div>
  36. </div>
  37. <div class="datagrid-item">
  38. <div class="datagrid-title">Edge network</div>
  39. <div class="datagrid-content">
  40. <span class="status status-green">
  41. Active
  42. </span>
  43. </div>
  44. </div>
  45. <div class="datagrid-item">
  46. <div class="datagrid-title">Avatars list</div>
  47. <div class="datagrid-content">
  48. <div class="avatar-list avatar-list-stacked">
  49. <span class="avatar avatar-xs rounded" style="background-image: url(/samples/avatars/029f.jpg)"></span>
  50. <span class="avatar avatar-xs rounded">JL</span>
  51. <span class="avatar avatar-xs rounded" style="background-image: url(/samples/avatars/015f.jpg)"></span>
  52. <span class="avatar avatar-xs rounded" style="background-image: url(/samples/avatars/004m.jpg)"></span>
  53. <span class="avatar avatar-xs rounded" style="background-image: url(/samples/avatars/037m.jpg)"></span>
  54. <span class="avatar avatar-xs rounded">+3</span>
  55. </div>
  56. </div>
  57. </div>
  58. <div class="datagrid-item">
  59. <div class="datagrid-title">Checkbox</div>
  60. <div class="datagrid-content">
  61. <label class="form-check">
  62. <input class="form-check-input" type="checkbox" checked />
  63. <span class="form-check-label">Click me</span>
  64. </label>
  65. </div>
  66. </div>
  67. <div class="datagrid-item">
  68. <div class="datagrid-title">Icon</div>
  69. <div class="datagrid-content">
  70. <svg xmlns="http://www.w3.org/2000/svg" class="icon text-green" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">
  71. <path stroke="none" d="M0 0h24v24H0z" fill="none" />
  72. <path d="M5 12l5 5l10 -10" />
  73. </svg>
  74. Checked
  75. </div>
  76. </div>
  77. <div class="datagrid-item">
  78. <div class="datagrid-title">Form control</div>
  79. <div class="datagrid-content">
  80. <input type="text" class="form-control form-control-flush" placeholder="Input placeholder" />
  81. </div>
  82. </div>
  83. <div class="datagrid-item">
  84. <div class="datagrid-title">Longer description</div>
  85. <div class="datagrid-content">
  86. Lorem ipsum dolor sit amet, consectetur adipisicing elit.
  87. </div>
  88. </div>
  89. </div>
  90. ```
  91. You can adjust the datagrid to your needs setting the values of variables:
  92. | Variable | Description | Default |
  93. |----------|-------------|---------|
  94. | `--tblr-datagrid-item-width` | Width of the datagrid item | `15rem` |
  95. | `--tblr-datagrid-padding` | Gap between the datagrid items | `1.5rem` |