Layout

Monster layout is built around stable spacing tokens, container-aware composition and predictable layers. The goal is not “fancy CSS”, but interfaces that stay readable when a split panel shrinks, when dark mode switches, and when components start nesting.

  • Design for the container. Components should react to the space they receive, not only to the viewport.
  • Use the spacing scale. Base gaps, padding and offsets on --monster-space-*.
  • Compose simple structures. Start with stack, cluster or split before adding specialized layout.
  • Use the shared layer model. Keep overlays on Monster layer tokens instead of local z-index values.

Preferred composition patterns

Start with one of these small structures before introducing a more specialized component.

Stack

Use vertical flow for forms, settings pages and article-like content.

Header block
Primary content
Secondary actions

Cluster

Use clustered items for badges, filters or short action groups that may wrap.

Status
Filter
Export

Split

Use split layouts when content and supporting controls need clear priority. The secondary area should collapse underneath when the container gets tight.

Primary working area
Side information / controls

Card groups

Cards are surfaces, not a full layout strategy. Use them inside stack or grid structures instead of relying on cards alone to define page rhythm.

Summary
Details
Actions

Responsive behavior

For page-level shells, viewport breakpoints still matter. For embedded demos, component docs and split panels, container queries are the safer default. That is why current showroom examples switch from two columns to one column based on available container width.

Use casePreferReason
Whole page shell@mediaViewport-level navigation and global framing.
Embedded component demo@containerWorks correctly inside split panels and documentation tabs.
Form rows and helper panels@containerAvoids crushed side columns when the parent panel narrows.
Artwork and broad landing sections@media plus tokensBest for top-level marketing-style composition.

Spacing scale

Monster spacing is intentionally small and consistent. Use the token values directly in CSS or their utility-class equivalents when the markup stays readable.

--monster-space-1
2px for tiny separators
--monster-space-2
4px for dense inline gaps
--monster-space-3
6px for compact controls
--monster-space-4
10px for default internal breathing room
--monster-space-5
16px for section gaps and card padding
--monster-space-6
26px for larger group separation
--monster-space-7
42px for strong section breaks
Utility classesPurpose
monster-margin-0..7Uniform outer spacing.
monster-padding-0..7Uniform inner spacing.
monster-margin-top-0..7 etc.Directional spacing for precise adjustments.
monster-padding-start-0..7 etc.Logical padding that respects writing direction.

Skeleton and loading states

Use skeletons for content that will appear in place shortly. Use the global boot loader for the application shell itself. Those are different responsibilities and should stay separate.

Layering and z-index

Layer tokens define a shared stack order for dropdowns, sticky elements, modals and tooltips. If a demo needs an overlay, use the Monster layer system instead of arbitrary local stacking numbers.

TokenTypical use
--monster-z-index-defaultNormal document flow and base components.
--monster-z-index-dropdownSelects, menus and lightweight floating panels.
--monster-z-index-stickySticky headers and controls that must stay above flowing content.
--monster-z-index-modalDialogs and strong focus-taking interfaces.
--monster-z-index-popoverPoppers and contextual overlays.
--monster-z-index-tooltipSmall transient explanations above everything else.

Display and visibility utilities

Utility display classes are useful for simple state changes, but they should not replace component state models. Use them for layout plumbing, not as a substitute for proper interaction logic.

ClassEffect
.block, .inline, .flex, .gridFast display switching for wrappers and demo shells.
.hidden, .none, .hideCompletely remove an element from layout flow.
.visible, .invisibleKeep layout participation while toggling visibility.

Do and don’t

  • Do: Combine Monster spacing tokens, logical padding and container queries so examples remain stable in narrow panels.
  • Don’t: Freeze demos with fixed widths, arbitrary pixel gaps or breakpoints that only work on the full page.

Related documentation

SplitPanel

Build resizable two-area layouts with a bounded, responsive Monster component.

Panel

Use the standard panel primitive for application shells and scrollable content regions.

The current width of the area is too small to display the content correctly.