A Svelte 5 web component with props and slots.
title and color)header, footer) and default slotInstall dependencies:
npm install
Run development server:
npm run dev
Build for production:
npm run build
After building, include the component in your HTML:
<script type="module" src="/dist/my-web-component.js"></script>
<my-component title="Hello!" color="blue">
<div slot="header">Custom Header</div>
<p>Main content goes here</p>
<div slot="footer">Custom Footer</div>
</my-component>
title (string): The title text (default: "Default Title")color (string): The border and title color (default: "blue")header: Content for the header sectionfooter: Content for the footer section