Show
Show renders its children only when the viewport falls inside a breakpoint range. Outside the range it returns nothing — the children leave the tree entirely.
What it is
A conditional wrapper keyed to the viewport width. above sets a lower bound, below sets an
upper one, and the two can combine to bracket a band. When the viewport matches, Show renders its
children; when it does not, Show returns null and the children — and their effects — are gone.
Install
Show is exported from usemotif. No separate install.
API
Show
stablefunction Show(props: ShowHideProps): JSX.Element | null
Render only when the viewport is at or above this breakpoint.
Render only when the viewport is below this breakpoint. Combine with `above` to bracket a range.
Rendered only when the viewport matches.
Examples
A desktop-only sidebar:
Content for a specific band — tablet only:
A Show / Hide pair branching one slot:
Cross-platform notes
On web Show evaluates the viewport width and renders or returns null. On native it uses the
same model against the device's window dimensions — the breakpoint names map to the same widths.
The children are dropped from the tree on both platforms; this is not a CSS display toggle.