v0.20.230 - 8.8 / 6.3

<Collapse .../>

Similar to <Show/> , it renders its children based on a condition, the difference is that the element is not removed from the document if the condition becomes falsy. Useful for iframes, canvas, video, audio.

# Attributes

nametypedescription
whenanyonce when becomes truthy, the children are shown. When it becomes falsy they are hidden but stay mounted, so iframes, canvases, video and audio keep their state.
fallbackanyrendered in place of the children while when is falsy

# Snippet

# Reactive

A youtube video keeps playing in the background even if the collapse element is set to be hidden

# Fallback

A youtube video keeps playing in the background and a fallback is shown