Skip to content
portalbits
Home Docs GitHub(opens in a new tab)

Guides

Get startedFoundationsMotion

Components

All components

Buttons

ButtonIconButton

Inputs

InputSelectTextareaSlider

Selection

CheckboxToggleToggleGroupSwitchRadioGroup

Identity

AvatarBadge

Overlays

DialogPopoverTooltipDropdownMenuAlertDialog

Disclosure

TabsAccordion

Cards

AppCardArticleCardFeatureCard

Content

CarouselSectionHeaderEmptyStateAlertProgressSeparatorRowListRow

Chrome

PortalShellSidebarNavMobileNavTopBarAuthFrameColorSelectorFloatingNav

SectionHeader

A heading, a description, and an optional action.

Your collection

Made for you.

Featured
Variations

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

NameTypeDefaultRequiredBindingDescription
titlestringNoneYesOne-wayThe heading, rendered as an `h2`.
descriptionstringNoneNoOne-waySupporting text under the heading.

Snippets

NameTypeDefaultRequiredBindingDescription
actionSnippetNoneNoOne-wayA 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`.

Related

  • EmptyState
  • RowList
Previous Carousel Next EmptyState

On this page

  • Preview
  • Source
  • API reference
  • Props
  • Snippets
  • Forwarded attributes
  • Limits