🎉Paper UI v2.0 is here!
See what's new

PUGrid Component

A flexible, responsive, hand-drawn style grid system for building complex layouts with ease.

Usage

Basic Usage

Item 1
Item 2
Item 3

Responsive Grid

Item 1
Item 2
Item 3
Item 4

Grid with Span

Large item (2 columns)
Small item
Small item
Full width item (4 columns)

Grid with Alignment

Top aligned
Centered
Bottom aligned

Complex Grid

Header
Menu
Sidebar
Content
Widget
Footer

Props

PropTypeRequiredDefaultDescription
colsnumber | stringNo1Number of columns or grid-template-columns value
rowsnumber | stringNoautoNumber of rows or grid-template-rows value
gapnone | small | medium | largeNomediumSpacing between grid items
alignmentstart | center | end | stretchNostretchVertical alignment of items
justifystart | center | end | space-between | space-around | space-evenlyNostartHorizontal alignment of items
responsivebooleanNotrueEnable responsive grid columns
customClassstringNo''Custom CSS classes

PUGridItem Props

PropTypeRequiredDefaultDescription
colStartnumberNo-Grid column start
colEndnumberNo-Grid column end
rowStartnumberNo-Grid row start
rowEndnumberNo-Grid row end
colSpannumberNo-Number of columns to span
rowSpannumberNo-Number of rows to span
alignmentstart | center | end | stretchNostretchVertical alignment of the item
justifystart | center | end | stretchNostretchHorizontal alignment of the item
customClassstringNo''Custom CSS classes

Features

  • Hand-drawn style borders and organic visual effects
  • Responsive: adapts to different screen sizes
  • Flexible: supports complex grid templates
  • Animations: smooth entry and hover effects
  • Dark mode support
  • Accessible: semantic structure and keyboard navigation

Advanced Examples

12-column grid

<PUGrid cols="repeat(12, 1fr)" gap="medium">
  <PUGridItem :col-span="8">Main content</PUGridItem>
  <PUGridItem :col-span="4">Sidebar</PUGridItem>
</PUGrid>

Fixed size columns

<PUGrid cols="200px 1fr 200px" gap="large">
  <PUGridItem>Left sidebar</PUGridItem>
  <PUGridItem>Content</PUGridItem>
  <PUGridItem>Right sidebar</PUGridItem>
</PUGrid>

Masonry grid

<PUGrid cols="repeat(auto-fill, minmax(250px, 1fr))" gap="medium">
  <PUGridItem v-for="i in 6" :key="i" :row-span="i % 2 === 0 ? 2 : 1">
    Item {{ i }}
  </PUGridItem>
</PUGrid>

Dependencies

  • Tailwind CSS for styling
  • Vue 3 Composition API