#Fallback content for Slot

7 messages · Page 1 of 1 (latest)

idle forge
#

Hello, is it possible to render fallback content for Slot? The following implementation doesn't work and I didn't find anything about it in the documentation.

import { component$, Slot } from '@builder.io/qwik';

const TestComponent = component$(() => {
  return <div>{Slot ? <Slot /> : 'This is my fallback content, if there is no child passed into slot'}</div>;
});

export default component$(() => {
  return (
    <>
      <TestComponent />
      <TestComponent>Test</TestComponent>
    </>
  );
});

https://qwik.dev/playground/#f=Q0o0xiam2BKNjgIoHeNNOhA%2FhgALWETBaos%2FBYEaE9Vgg%2B0VbMC0vp2ClYI6uCgAotxKhbTEnBxQyQ4uXoDG6ChkpoFKT2CRBlSQl6%2BQDC6TC4DND2CNBiwTgVUj0CD1WkhTBZImSUnW6JGB6iFEUKKI24F4NvqoYmjBPJo3hmTeAAA

Qwik

No hydration, auto lazy-loading, edge-optimized, and fun 🎉!

fierce yarrow
fierce yarrow
#
Qwik

No hydration, auto lazy-loading, edge-optimized, and fun 🎉!

#

issue related

#

so i guess there is css solution