Skip to main content

Layouts

Information : This is not required for any component to work.

Out of the box, the preferred layout is the grid system for the pages. The grid system allows to have fine control over UI elements and utilize media breakpoints for responsiveness. The design guide also has layouts available for the grid system.

ravixUI uses a the 12 point grid system to give fine tuned control for placing blocks on the page. The table below has the specifications used for the layout.

BreakpointMinimum WidthTailwind ClassMargins and Padding
2xl1536pxgrid grid-cols-12 gap-4 mx-40160px of horizontal margin with 16px padding
xl1280pxgrid grid-cols-12 gap-4 mx-32128px of horizontal margin with 16px padding
lg1024pxgrid grid-cols-12 gap-4 mx-2080px of horizontal margin with 16px padding
md768pxgrid grid-cols-12 gap-4 mx-1248px of horizontal margin with 16px padding
sm640pxgrid grid-cols-12 gap-4 mx-1040px of horizontal margin with 16px padding
< 640px0pxgrid grid-cols-12 gap-4 mx-416px of horizontal margin with 16px padding

Well, that’s not responsive at all, is it now? To make it responsive your code would be something like this :

Code

index.html
<!-- head,scripts,etc. here-->
<body>
<div
class="mx-4 grid grid-cols-12 gap-4 sm:mx-10 md:mx-12 lg:mx-20 xl:mx-32 2xl:mx-40"
>
<!-- Your page, blocks, content, etc. here -->
</div>
</body>
<!-- footer,scripts,etc. here -->

And this is the pattern used to build responsiveness for all blocks available in ravixUI out of the box.