Skip to content

Show Hide

Overview

ShowHide toggles element visibility using CSS display: none / display: revert. Unlike conditional rendering, the element stays in the DOM when hidden, preserving component state, form values, and scroll positions.

Usage

<div class="pm-show">Visible content</div>
<div class="pm-hide">Hidden content (stays in DOM)</div>

Guidelines

  • Use when you need to preserve internal state while hiding content
  • Use conditional rendering ({show && <Child />}) when you want to fully unmount
  • pm-show uses display: revert to preserve the element’s original display type
  • pm-hide uses display: none

API

PropTypeDefaultDescription
display"show" | "hide""show"The visibility state