Skip to content

Match

function Match(__namedParameters): Element | null;

Conditionally render content based on terminal dimensions.

Match evaluates a media query against the current terminal size and renders children when all conditions are met, or fallback otherwise. The component re-renders automatically on terminal resize.

All query props are combined with AND — every specified constraint must be satisfied for children to render.

ParameterType
__namedParametersMatchProps

Element | null

// Show wide layout on terminals ≥ 80 columns
<Match minColumns={80}>
<HorizontalLayout />
</Match>
// With a fallback for narrow terminals
<Match minColumns={80} fallback={<CompactView />}>
<FullView />
</Match>
// Compound query — width AND height
<Match minColumns={120} minRows={30}>
<DashboardLayout />
</Match>

PropertyTypeDescriptionInherited from
children?ReactNodeContent to render when the media query matches.-
fallback?ReactNodeContent to render when the media query does not match. Default null-
maxColumns?numberMaximum terminal width in columns (inclusive).MediaQueryInput.maxColumns
maxRows?numberMaximum terminal height in rows (inclusive).MediaQueryInput.maxRows
minColumns?numberMinimum terminal width in columns (inclusive).MediaQueryInput.minColumns
minRows?numberMinimum terminal height in rows (inclusive).MediaQueryInput.minRows