The button hides or shows the component, depending on whether the component is already showing on the page."
One way we typically accomplish this is to have a ui-only model that determines the rendering of certain components. (e.g. if a checkbox is false, the component won’t render).
With the first button, this sounds like unexpected behavior - the component should be displayed on page load unless the model has no data or it has rendering conditions hiding it.