Skip to main content
US Army Corps of EngineersInstitute for Water Resources, Risk Management Center

Responsive Design

The responsive system has three layers: reference devices for testing, Tailwind breakpoints for CSS, and a JS tier system for component logic.


Reference Devices

These are the specific viewports used for screenshots, manual QA, and design review. Every layout must look correct at these sizes.

TierWidthHeightDPR
Phone393px852px3
Tablet820px1180px2
Laptop1280px720px1.5
Desktop 16:91920px1080px1
Desktop 16:101920px1200px1

Tailwind Breakpoints

These are defined in index.css and used in Tailwind classes (sm:, lg:, 2xl:, etc.).

Device-Tier Breakpoints

Control layout, navigation, and grid structure:

BreakpointCSS min-widthTransition
sm640pxPhone → tablet
lg1080pxTablet → laptop
2xl1536pxLaptop → desktop

Fine-Grained Breakpoints

Adjustments within a tier:

BreakpointCSS min-widthUsage
md768pxMid-tablet adjustments
xl1280pxMid-laptop adjustments

Custom Component Breakpoints

Pixel-specific breakpoints for table and component overflow. Do not modify these without updating the corresponding components:

BreakpointComponent
1235pxFMEvaluationTable layout
1315pxFMEvaluationTable label display
1375pxPFM01GeometrySection layout
1415pxFailure Mode Selection page layout
1655pxFMEvaluationTable APF/EALL/EAD labels
1730pxEmbankmentMaterialTable horizontal scrolling

JS Tier System

Layout.jsx computes a tier value ('phone' | 'tablet' | 'laptop' | 'desktop') from the viewport width and passes it to layout components like TabNavigation. Use the tier system for navigation and layout decisions in JavaScript instead of raw window.innerWidth checks.

TierViewportMaps To
phone< 640pxsm breakpoint
tablet640–1079pxlg breakpoint
laptop1080–1535px2xl breakpoint
desktop≥ 1536pxAbove 2xl
TierNavigation Style
PhoneHamburger menu with slide-out drawer (no sidebar)
TabletCollapsed icon sidebar (56px, always collapsed, no toggle)
Laptop/DesktopFull expandable sidebar (240px, with collapse toggle)

Common Responsive Patterns

{/* Two-column section layout (dam-information pattern) */}
<PageContainer>
<div className="w-full divide-y divide-slate-200 *:pt-6 *:first:pt-0 *:pb-6 *:last:pb-0">
<div className="grid grid-cols-1 gap-8 lg:grid-cols-2">
<DamOverviewSection />
<EmbankmentComponentsSection />
</div>
<EmbankmentMaterialsSection />
</div>
</PageContainer>

{/* Form inputs beside diagram (pfm01 pattern) */}
<Section title="Embankment overtopping parameters">
<div className="grid grid-cols-1 items-center gap-4 lg:grid-cols-[45%_1fr]">
<div className="grid grid-cols-2 gap-x-4 gap-y-4">
<InputField label="Embankment Height (ft)" inputVariant="compact" ... />
<InputField label="Downstream Slope (H:V)" inputVariant="compact" ... />
</div>
<OvertoppingProfileDiagram ... />
</div>
</Section>

{/* Table + chart side-by-side (40/60 split) */}
<div className="grid grid-cols-1 gap-6 xl:grid-cols-[40%_60%]">
<div className="min-w-0"><SRPTable /></div>
<div className="h-96 min-w-0"><SRPChart /></div>
</div>

{/* Responsive form grid */}
<FormFieldGroup columns={3}>
<InputField label="Field 1" ... />
<InputField label="Field 2" ... />
<InputField label="Field 3" ... />
</FormFieldGroup>

{/* Two-column with divider (failure-mode-screening pattern) */}
<div className="grid grid-cols-1 gap-8 xl:grid-cols-2 xl:gap-6">
<div className="space-y-6">{/* Column 1 */}</div>
<div className="space-y-6 xl:border-l xl:border-slate-300 xl:pl-6">{/* Column 2 */}</div>
</div>

Key patterns:

  • Use divide-y divide-slate-200 with *:pt-6 *:pb-6 for vertically stacked sections with dividers
  • Always add min-w-0 to grid children to prevent content overflow
  • Use grid-cols-[45%_1fr] or grid-cols-[minmax(0,2fr)_minmax(0,3fr)] for flexible asymmetric splits
  • Use space-y-2 for tight checkbox lists, space-y-6 for section spacing

Fluid Typography

Font sizes use clamp() for responsive scaling between 375px and 1920px viewport widths. These are defined in index.css and override Tailwind's defaults — just use standard Tailwind text size classes (text-sm, text-lg, etc.) and the responsive scaling is automatic.