Skip to content

Layout

The Mukoko layout system is mobile-first, using Tailwind CSS breakpoints and a consistent spacing scale. Every layout decision starts from the smallest screen and progressively enhances.

Mukoko uses Tailwind’s default breakpoints:

Breakpoint Min width Target
(default) 0px Mobile phones
sm 640px Large phones, small tablets
md 768px Tablets
lg 1024px Laptops
xl 1280px Desktops
2xl 1536px Large screens

Always write mobile styles first, then add breakpoint modifiers:

// Correct — mobile-first
<div className="grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3">
// Incorrect — desktop-first
<div className="grid grid-cols-3 md:grid-cols-2 sm:grid-cols-1">

The spacing scale follows Tailwind’s default values, with these commonly used sizes in Mukoko apps:

Token Value Usage
1 4px Tight gaps (icon-to-text)
1.5 6px Compact padding
2 8px Standard small gap
3 12px Component internal padding
4 16px Standard gap, card padding
6 24px Section padding (mobile)
8 32px Section padding (desktop)
12 48px Large section spacing
16 64px Page section separation
24 96px Hero spacing

Maintain consistent vertical rhythm by using multiples of 4px:

<section className="px-4 py-12 sm:px-6 sm:py-16 md:py-24">
<div className="mx-auto max-w-5xl">
<h2 className="mb-4">Section title</h2>
<p className="mb-8">Description text</p>
<div className="grid gap-4 sm:gap-6">
{/* Content */}
</div>
</div>
</section>

The standard content container:

<div className="mx-auto max-w-5xl px-4 sm:px-6">
{/* Content */}
</div>

Common max-widths used in Mukoko apps:

Class Width Usage
max-w-2xl 672px Narrow content (blog posts, forms)
max-w-4xl 896px Standard content
max-w-5xl 1024px Wide content (landing pages)
max-w-6xl 1152px Full-width content
max-w-7xl 1280px Dashboard layouts

For sections that span the full viewport width but contain centered content:

<section className="w-full bg-muted">
<div className="mx-auto max-w-5xl px-4 py-16 sm:px-6">
{/* Centered content */}
</div>
</section>
{/* Responsive 1 → 2 → 3 column grid */}
<div className="grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3">
<Card>...</Card>
</div>
<div className="flex min-h-screen">
<aside className="hidden w-64 border-r border-border md:block">
{/* Sidebar */}
</aside>
<main className="flex-1 p-4 sm:p-6">
{/* Main content */}
</main>
</div>

For vertical content with consistent spacing:

<div className="flex flex-col gap-4">
<Component />
<Component />
<Component />
</div>

Given that most Mukoko users are on mobile devices in Africa:

  • Touch targets — hit area of at least 45px on touch for all interactive elements, 24px with a fine pointer; dense controls keep the full hit area (Bundu floor 1.1.0)
  • Thumb zones — place primary actions in the bottom half of the screen
  • Bottom navigation — use mukoko-bottom-nav for app-level navigation on mobile
  • Sheet over dialog — on mobile, prefer Sheet (slides from bottom) over Dialog (centered modal)
  • Horizontal scroll — avoid horizontal scrolling; use stacked layouts on mobile
  • Loading states — show skeleton placeholders immediately; users on slow connections need visual feedback