Skip to content

Show and Hide

Show and Hide are components that make a decision on whether to display it's child based on a condition. Show is used to display it's child when a condition is true. Hide does the opposite. It hides when a condition is true.

Show

<Show when={isPublished} >
"Content"
</Show>

Props

These are the acceptable props.

Required

namedescription
whenIf this prop is true the child will be rendered.
childrenAn HTML Element or string to be rendered

Optional

namedescription
cloakA prop that is used to set the element that is not meant to be shown to display:none instead of it not being rendered.

Hide

<Hide when={!isPublished} >
"Content"
</Hide>

Props

Required

namedescription
whenIf this prop is true the child won't be rendered.
childrenAn HTML Element or string to be rendered

Optional

namedescription
cloakA prop that is used to set the element that is not meant to be shown to display:none instead of it not being rendered.