Homecomponentscontrol-flow

Match

A control-flow to pick one of the several branches.

Alpha
This component is in development. There could be breaking changes made to it in a non-major release of Prism. Please use with caution.

Use Match and Case to display one of many matching conditions. Use Else to show a fallback.

Welcome home

API

Match

children
Required
A list of Case and optional Else.
Element | Element[]

Case

when
Required
Show the content when the condition is true.
true
false

children
Required
The content to show when the condition is true.
ReactNode

Else

children
Required
Show the content when no Case is true.
ReactNode
Table of Contents