MonterUI Page Layout Guide

This guide will discuss 3 tools for laying out your app pages, Grid, Flexbox, and Columns. This page will discuss the strengths and when to use each individually, and then a section for how to combine them for more complex layouts at the end.

Note: This guide is designed to get you started building layouts quickly, not to teach you all the details needed to build every possible custom layout with pixel-perfect control. To get more detailed and lower-level control, explore the tailwind docs.

This guide is for creating flexible layouts you envision, but does not discuss responsiveness to make different layouts that are both mobile and desktop friendly. Stay tunes for a responsiveness guide that will help with that!

Grid

Grids are best for regular predictable layouts with lots of the same shape of things that may need to change a lot for different screen sizes. I think the best way to see what it can do is to see a bunch of examples, so here they are!

Minimal Image Cards

This is a minimal example of a grid that just shows image and text. This is the foundation for many more complex layouts so make sure to understand what's going on here first before moving on!

A grid lays things out in a...grid. As you can see, we have evenly sized cards by default.

Image 0

Image 1

Image 2

Image 3

Image 4

Image 5

Dashboard Example

However, they don't have to be evenly sized! By providing row-span-{int} and col-span-{int} we can control how many rows or columns specific grid elements take up. By doing this, we can create a grid that has lots of different shapes and types of elements.

Let's look at a dashboard layout at an examples of this.

SideBar

Total Users

1,234

Active Now

342

Revenue

$45,678

Conversion

2.4%

Monthly Revenue

Chart Goes Here

User Growth

Chart Goes Here

Flexbox

Using Grid for the overall layout, and flex for the individual elements is a powerful pattern. With MonsterUI you can do quite a bit without knowing anything about flexbox, which is what will be taught here.

However, flexbox is well worth learning about it in more detail. You will run into situations where you need more flexbox knowledge than is covered here to build your vision. Thankfully you can get that knowledge by playing a fantastic tutorial game called FlexBox Froggy!

Forms

Often you want to stack things horizontally. You can use the DivHStacked component to do this.

DivHStacked is a helper function for flexbox and creates a div with these classes by default cls=(FlexT.block, FlexT.row, FlexT.middle, 'space-x-4').

Form with Input Groups

Avatar

You can use this same DivHStacked to align things like text next to images. And you can use DivVStacked to stack things vertically to create design structures you like. DivVStacked works by using cls=(FlexT.block,FlexT.column,FlexT.middle)

Avatar

John Doe

[email protected]

+1-123-456-7890

Pricing Card

These can be combined with icons and other styling to create larger components like a pricing card.

Pro Plan

$99

per month

  • Unlimited users
  • 24/7 priority support
  • Custom branding options
  • Advanced analytics dashboard
  • Full API access
  • Priority request queue

Footer

Or you can combine things to make advanced footers that have titles, organized links, and icons!

In this example we add another flex helper function, DivFullySpaced. DivFullySpaced is a flex class that puts as much space between items as possible

Company Name



© 2024 Company Name. All rights reserved.

Dashboard

Welcome back, Isaac!

Here's what's happening with your projects today.

Total Projects

12

+2.5% from last month

Hours Logged

164

+12.3% from last month

Tasks Complete

64%

-4.1% from last month

Team Velocity

23

+8.4% from last month

Recent Activity

Avatar

Sarah Chen completed Project Alpha deployment

2h ago

Avatar

James Wilson commented on Project Beta

4h ago

Avatar

Maria Garcia uploaded new design files

6h ago

Avatar

Alex Kumar started Sprint Planning

8h ago

Columns

Columns are a great for sections that have a lot of text.

Lorem Ipsum

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.

Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium.

Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor.