SectionHeader
A heading, a description, and an optional action.
Your collection
Made for you.
Featured
Source
<script lang="ts">
import 'portal-bits/styles.css';
import 'portal-bits/tokens.css';
import type { Snippet } from 'svelte';
let { children }: { children: Snippet } = $props();
</script>
{@render children()}
<script lang="ts">
import SectionHeaderExample from './SectionHeaderExample.svelte';
</script>
<SectionHeaderExample description={true} action={true} />
<script lang="ts">
import { Badge, SectionHeader } from 'portal-bits';
let { description = true, action = true }: { description?: boolean; action?: boolean } = $props();
</script>
{#snippet featured()}<Badge variant="spotlight">Featured</Badge>{/snippet}
<SectionHeader
title="Your collection"
description={description ? 'Made for you.' : undefined}
action={action ? featured : undefined}
/>
API reference
These tables list the props and snippets that SectionHeader declares. Attributes passed through to an element or primitive are listed under Forwarded attributes, not here.
Props
| Name | Type | Default | Required | Binding | Description |
|---|---|---|---|---|---|
title | string | None | Yes | One-way | The heading, rendered as an `h2`. |
description | string | None | No | One-way | Supporting text under the heading. |
Snippets
| Name | Type | Default | Required | Binding | Description |
|---|---|---|---|---|---|
action | Snippet | None | No | One-way | A control placed beside the heading. |
Forwarded attributes
None. SectionHeader forwards no attributes.
No data attributes are documented as stable.
Limits
- The heading level is fixed at `h2`.