check
Code copied to clipboard.
close
menu

Grid

The Grid is simply a <div> with basic grid styles preapplied. It provides a convenient shorthand for controlling common grid styles like column count and gap size using props.

Example Instance

<Grid columns={2} gap="md">
  <div style={{ background: "red" }}>Item 1</div>
  <div style={{ background: "blue" }}>Item 2</div>
</Grid>
content_copy
warning
Note: The above snippet omits import statements and surrounding markup. It's assumed you'd be pasting this inside the return block of an existing functional component.

Installation

Next.js

Note: Other React frameworks are not currently supported, but they might still work. Try at your own risk.

Method Instructions
LiftKit CLI
From any Next.js project, run the following command in your terminal.
npm run add grid
content_copy
Github open_in_new View on Github

Props

Unique

Props unique to this component.

Name Required Type Description Default Val
autoResponsive no boolean Whether the grid should automatically adjust to different screen sizes. false
className no string Additional CSS classes to apply undefined
columns no number The number of columns for the grid layout undefined
gap no LkSizeUnit The spacing between grid items. Expects LkSizeUnit from 3xs to 4xl. undefined

Common

Props with globally-defined behavior that are used in multiple components.

Common PropsStatus
{children}Supported
Native HTML attributesSupported