Skip to content

KGrid

Quickly and easily create layouts with the basic 24-column.

TIP

The component uses flex layout by default, no need to set type="flex" manually.

Please note that the parent container should avoid using inline related styles, which will cause the component to not fill up its width.

Install

bash
pnpm add @ikun-ui/grid
bash
yarn add @ikun-ui/grid
bash
npm install @ikun-ui/grid

Basic usage

KGrid consists of 2 components, namely KCol, KRol.
Create basic grid layout using columns.

Column spacing

Use the gutter attribute to increase the gap between column

Hybrid layout

Form a more complex hybrid layout by combining the basic 1/24 columns.

Column offset

The offset attribute lets you specify a column offset.

Alignment

You can define the formatting method of child elements through the justify attribute.

Responsive Layout

five breakpoints are preset: xs, sm, md, lg and xl.

KRow Props

NameTypeDefaultDescription
gutternumber0grid spacing
justify'start'|'end'|'center'|'around'|'between'|'evenly'starthorizontal alignment of flex layout
aligntop | middle | bottom-vertical alignment of flex layout
tagstringdivcustom element tag
clsstring'-'Additional class
attrsRecord<string, string>{}Additional attributes

KRow Slots

NameDescription
defaultCustomize default content, Please pass in the KCol component

KCol Props

NameTypeDefaultDescription
spannumber24number of column the grid spans, The optional range is 0 ~ 24
offsetnumber0number of spacing on the left side of the grid
pushnumber0number of columns that grid moves to the right
pullnumber0number of columns that grid moves to the left
xsnumber| {span?: number, offset?: number, pull?: number, push?: number}-<768px Responsive columns or column props object
smnumber| {span?: number, offset?: number, pull?: number, push?: number}-≥768px Responsive columns or column props object
mdnumber| {span?: number, offset?: number, pull?: number, push?: number}-≥992px Responsive columns or column props object
lgnumber| {span?: number, offset?: number, pull?: number, push?: number}-≥1200px Responsive columns or column props object
xlnumber| {span?: number, offset?: number, pull?: number, push?: number}-≥1920px Responsive columns or column props object
tagstringdivcustom element tag
clsstring'-'Additional class
attrsRecord<string, string>{}Additional attributes

KCol Slots

NameDescription
defaultCustomize default content

MIT Licensed