Show

Show is a declarative component for conditional rendering. When when is truthy it renders children; otherwise it renders the fallback (or nothing). This keeps branching logic out of JSX and makes intent explicit.

Basic usage#

Pass a condition to when and optionally provide fallback. If children is a function, it receives the evaluated value at render time.

Multiple conditions (array)#

If you pass an array to when, children render only when every item is truthy. The function child receives the array values.

DOM-preserving variants#

Use Show.div or Show.span to keep an outer element in the DOM while swapping inner content.

Components - Control Flow Utilities | ilokesto - React Library Collection