Layout

Grid

Design concept

100%
25%
25%
25%
25%
33.33%
33.33%
33.33%
50%
50%
66.66%
33.33%

This section comes from the original Ant Design documentation.

In most business situations, Lqvrent UI needs to solve a lot of information storage problems within the design area, so based on 12 Grids System, we divided the design area into 24 sections.

We name the divided area 'box'. We suggest four boxes for horizontal arrangement at most, one at least. Boxes are proportional to the entire screen as shown in the picture above. To ensure a high level of visual comfort, we customize the typography inside of the box based on the box unit.


Description

Design grid system based on Ant Design.


Outline

This section comes from the original Ant Design documentation.

In the grid system, we define the frame outside the information area based on row and column, to ensure that every area can have stable arrangement.

Following is a brief look at how it works:

  • Establish a set of column in the horizontal space defined by row (abbreviated col)
  • Your content elements should be placed directly in the col, and only col should be placed directly in row
  • The column grid system is a value of 1-24 to represent its range spans. For example, three columns of equal width can be created by <div lui-col [luiSpan]="8" />.
  • If the sum of col spans in a row are more than 24, then the overflowing col as a whole will start a new line arrangement.

Our grid systems base on Flex layout to allow the elements within the parent to be aligned horizontally - left, center, right, wide arrangement, and decentralized arrangement. The Grid system also supports vertical alignment - top aligned, vertically centered, bottom-aligned. You can also define the order of elements by using order.

Layout uses a 24 grid layout to define the width of each "box", but does not rigidly adhere to the grid layout.


Breakpoints

By default, the grid system will use the default Tailwind breakpoints.
If you didn't changed your breakpoints, the grid system will use the following breakpoints (in pixels, min width for each breakpoint):

const breakpoints = {
  'sm': 640,
  'md': 768,
  'lg': 1024,
  'xl': 1280,
  '2xl': 1536,
};

If you changed your tailwind breakpoints, you can tell the library to use your breakpoints by providing the breakpoints property in the global configuration.
Here is an example of how to provide your breakpoints:

import { LuiConfig, LuiConfigService, provideLuiConfig } from '@lqvrent-workspace/lqvrent-ui/core/config';

const config: LuiConfig = {
  breakpoints: {
    'sm': 640,
    'md': 768,
    'lg': 1024,
    'xl': 1280,
    '2xl': 1536,
  },
  // ...
};

@Component({
  selector: 'app-root',
  standalone: true,
  imports: [
    // ...
  ],
  providers: [
    provideLuiConfig(config),
  ],
  templateUrl: './app.component.html',
})
export class AppComponent {
  constructor() { }
}

API

Supports global configuration

View the default configuration for this component. Learn more about global configuration.

import { LuiGridModule } from '@lqvrent-workspace/lqvrent-ui/grid';
<div lui-row>
  <div lui-col luiSpan="12">50%</div>
  <div lui-col luiSpan="12">50%</div>
</div>

[lui-row]

directive Standalone
PropertyDescriptionTypeDefault
[luiAlign]Vertical alignment'top' | 'middle' | 'bottom'-
[luiJustify]Horizontal alignment'start' | 'end' | 'center' | 'space-around' | 'space-between' | 'space-evenly'-
[luiGutter]spacing between grids, see the example belowstring | number | object | [number, number] | [object, object]0

[lui-col]

directive Standalone
PropertyDescriptionTypeDefault
[luiFlex]Flex stylestring | number-
[luiSpan]Raster number of cells to occupynumber0
[luiOrder]Raster ordernumber0
[luiOffset]Number of cells to offset from the leftnumber0
[luiPush]The number of cells that raster is moved to the leftnumber0
[luiPull]The number of cells that raster is moved to the rightnumber0
[luiXs]<640px and also default setting, could be a span value or an object containing above propsnumber |object-
[luiSm]≥640px, could be a span value or an object containing above propsnumber |object-
[luiMd]≥768px, could be a span value or an object containing above propsnumber |object-
[luiLg]≥1024px, could be a span value or an object containing above propsnumber |object-
[luiXl]≥1280px, could be a span value or an object containing above propsnumber |object-
[lui2xl]≥1536px, could be a span value or an object containing above propsnumber |object-

More examples

Basic

col-12
col-12
col-8
col-8
col-8
col-6
col-6
col-6
col-6

Gutter

Basic

col-12
col-12

Responsive

col-8
col-8
col-8

Vertical

col-6
col-6
col-6
col-6
col-6
col-6
col-6
col-6

Column offset

col-8
col-8-offset-8
col-6-offset-6
col-6-offset-6
col-12-offset-6

Column sort

col-18-push-6
col-6-pull-18

Column order

1 col-6-order-4
2 col-6-order-3
3 col-6-order-2
4 col-6-order-1

Justify

Start

col-4
col-4
col-4
col-4

Center

col-4
col-4
col-4
col-4

End

col-4
col-4
col-4
col-4

Space between

col-4
col-4
col-4
col-4

Space around

col-4
col-4
col-4
col-4

Space evenly

col-4
col-4
col-4
col-4

Align

Top

col-4
col-4
col-4
col-4

Middle

col-4
col-4
col-4
col-4

Bottom

col-4
col-4
col-4
col-4

Flex

Percentage columns

2/5
3/5

Fill rest

100px
Fill rest

Raw flex style

1 1 200px
0 1 300px

Responsive

Col
Col
Col

Advanced responsive

Col
Col
Col
Previous
Divider