The responsive grid system in PrimeNG
PrimeNG has Grid CSS--a responsive and fluid layout system optimized for mobile devices, tablets, and desktops. PrimeNG components use Grid CSS internally, but this lightweight utility can be used as standalone as well. CSS Grid is based on the 12-columns layout as many other grid systems. The total width of all columns is 100%. In this section, we will explain all features of the PrimeNG grid system in details.
Basic principles
The layout container should have the ui-g
style class. Children elements of the layout container become columns when they are prefixed with ui-g-*
where *
is any number from 1 to 12. The number expresses the taken space of 12 available units. When the number of columns exceeds 12, columns wrap to the next line:
<div class="ui-g"> <div class="ui-g-2">2</div> <div class="ui-g-4">4</div> <div class="ui-g-6">6</div> <div class="ui-g-8">8</div> <div class="ui-g-4">...