Grid system
MiHCM uses a mobile-first responsive grid built on Tailwind utilities, the system spacing scale, and constrained page containers. There is no separate grid package: the contract is the documented breakpoint, gutter, column, and container rules below.
Use semantic colour tokens, spacing tokens, and standard responsive utilities. Avoid raw pixel layout values unless the value is part of a documented component contract.
Rules
These are the non-negotiable layout rules for MiHCM screens and examples.
Breakpoints
Breakpoints follow Tailwind's default mobile-first contract. Unprefixed classes apply to every size; prefixed classes apply at that width and above.
base0px+sm640px+md768px+lg1024px+xl1280px+2xl1536px+basesmmdlgxl2xl<section className="grid grid-cols-1 gap-4 md:grid-cols-2 xl:grid-cols-4">
<StatCard />
<StatCard />
<StatCard />
<StatCard />
</section>Containers
Pick the smallest container that supports the workflow. Wide screens should improve scanability, not make every line longer.
max-w-3xl768pxLong-form documentation and readable policy content.
max-w-5xl1024pxMost docs, forms, settings pages, and focused workflows.
max-w-7xl1280pxDashboards, grids, comparison pages, admin consoles.
w-fullfluidApp shells, split panes, maps, data tables with horizontal scroll.
Gutters
Use spacing tokens for all gutters. The defaults below keep small screens usable and desktop screens readable.
gap-2 / 8pxToolbar icon groups, inline filters.
gap-4 / 16pxCards, form fields, dashboard blocks.
gap-6 / 24pxPrimary page regions and split layouts.
Twelve-column showcase
Use the 12-column model for desktop composition, then collapse to simple stacks on small screens.
Recipes
Use these recipes as the default implementation path before creating a custom layout.
grid grid-cols-1 gap-4Default. Start every layout here.
grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3Cards with similar weight and independent actions.
grid grid-cols-1 gap-4 md:grid-cols-2 xl:grid-cols-4KPI tiles and monitoring summaries.
grid grid-cols-1 gap-6 lg:grid-cols-[minmax(0,1fr)_20rem]Primary content with a right-side summary panel.
grid grid-cols-12 gap-4Complex desktop composition. Hide the 12-column model behind clear spans.
Dashboard layout
Dashboards should preserve hierarchy: KPI cards first, primary visualization next, secondary panels last.
Form layout
Forms should be one column on mobile, two columns for related fields at md and above, and constrained to a readable width.
Data layout
Dense data should keep structure. Let tables scroll when columns cannot fit; do not shrink text below the type scale.
<div className="overflow-x-auto">
<Table className="min-w-full">
...
</Table>
</div>Accessibility
Responsive layout changes must preserve reading order, focus order, and target size.
End-to-end checklist
Use this checklist before shipping a new screen, docs example, or template.
- Start with a 375px single-column layout.
- Use
px-4 sm:px-6 lg:px-8for page gutters unless the host shell already provides padding. - Choose a container:
max-w-3xl,max-w-5xl,max-w-7xl, or full viewport. - Use
gap-4inside cards andgap-6between major sections. - Promote to two columns at
mdonly when both columns remain readable. - Promote to 12 columns at
lgonly for complex desktop composition. - Verify light mode, dark mode, keyboard order, 200% zoom, and horizontal overflow.