@arcmantle/lit-jsx
    Preparing search index...
    • Conditionally renders content based on a truthy value.

      Type Parameters

      • C

      Parameters

      • props: {
            children:
                | [
                    true: (value: NoInfer<C>) => unknown,
                    false: (value: NoInfer<C>) => unknown,
                ]
                | ((value: NoInfer<C>) => unknown);
            when: C;
        }
        • children:
              | [
                  true: (value: NoInfer<C>) => unknown,
                  false: (value: NoInfer<C>) => unknown,
              ]
              | ((value: NoInfer<C>) => unknown)

          A single render or tuple containing render functions for true and optionally false cases

        • when: C

          The condition value to evaluate for truthiness

      Returns unknown

      The rendered JSX element based on the condition's truthiness

      <Show when={user}>
      {(user) => <div>Welcome, {user.name}!</div>}
      {() => <div>Please log in</div>}
      </Show>

      // Or without fallback
      <Show when={isVisible}>
      {() => <div>This content is visible</div>}
      </Show>