<Show .../>
Renders its children based on a condition. For the condition to be reactive it needs to be function
# Attributes
name | type | description |
---|---|---|
when | any | once when becomes truthy, it will show its children |
fallback? | any | a thing to render as fallback when the condition is falsy |
# Snippet
# Static true/false
Test using static values
# Reactive Value
Test using a signal and also the signal value
# Rendering
How many times a children renders by a toggling signal
# Avoiding Re-rendering
Using the children helper we can avoid re rendering
# Fallback
A fallback renders a component when the condition becomes false
# Fallback Signal
Tests a signal for a fallback.
# Callback
Using the value from the condition in a callback
# Callbacks
Children are arrays, so the callbacks could be anywhere
# Callbacks Null
Test what happens when a value for a callback becomes null
# Show In Between
In between 2 elements and in between 2 text nodes