@molecule/app-detail-header-svelte

Feature · detail-header · App (browser) · v1.1.3 · Apache-2.0

Detail-page top bar with title, subtitle, status, actions, breadcrumb, optional search

npm install @molecule/app-detail-header-svelte

npm · Source on GitHub

How it works

@molecule/app-detail-header-svelte is a ready-made detail-header feature for the app (browser) side. It composes the core interfaces it needs, so it works with whichever providers your app has bonded.

<script lang="ts">
  import { DetailHeader } from '@molecule/app-detail-header-svelte'
  import { Button } from '@molecule/app-ui-svelte'
  import { StatusBadge } from '@molecule/app-status-badge-svelte'
</script>

<DetailHeader title="Project Alpha" subtitle="Last updated 2 hours ago" sticky>
  {#snippet status()}
    <StatusBadge kind="success">Active</StatusBadge>
  {/snippet}
  {#snippet actions()}
    <Button variant="solid" onclick={handleEdit}>Edit</Button>
  {/snippet}
  {#snippet meta()}
    <span>Owner: Alice</span>
  {/snippet}
</DetailHeader>

Works with: @molecule/app-svelte, @molecule/app-ui, @molecule/app-ui-svelte

Reference

Svelte detail-page header — the Svelte counterpart of @molecule/app-detail-header-react, with the same props and the same DOM.

Exports DetailHeader — leading slot + title/subtitle + status + right-aligned actions, with an optional meta row and an optional search slot. Different from <PageHeader> (top of list/index pages) in prioritising status + search + stickiness for long-scrolling detail screens. All slots are snippet props — compose any components.

Auto-generated, AI-first package reference for the molecule.dev ecosystem. It is written to be read by coding agents as much as by people, and is generated from this package's source — edit src/index.ts JSDoc, not this file.

Quick Start

<script lang="ts">
  import { DetailHeader } from '@molecule/app-detail-header-svelte'
  import { Button } from '@molecule/app-ui-svelte'
  import { StatusBadge } from '@molecule/app-status-badge-svelte'
</script>

<DetailHeader title="Project Alpha" subtitle="Last updated 2 hours ago" sticky>
  {#snippet status()}
    <StatusBadge kind="success">Active</StatusBadge>
  {/snippet}
  {#snippet actions()}
    <Button variant="solid" onclick={handleEdit}>Edit</Button>
  {/snippet}
  {#snippet meta()}
    <span>Owner: Alice</span>
  {/snippet}
</DetailHeader>

Type

feature

Installation

npm install @molecule/app-detail-header-svelte @molecule/app-svelte @molecule/app-ui @molecule/app-ui-svelte svelte

API

Interfaces

DetailHeaderProps

Props accepted by the DetailHeader component.

interface DetailHeaderProps {
  /** Primary heading — a snippet or a plain string. */
  title: Snippet | string
  /** Optional subtitle shown below the title — a snippet or a plain string. */
  subtitle?: Snippet | string
  /** Optional leading avatar / icon / logo — a snippet or a plain string. */
  leading?: Snippet | string
  /** Optional status indicator (e.g. a `<StatusBadge>`) — a snippet or a plain string. */
  status?: Snippet | string
  /** Right-aligned actions — a snippet or a plain string. */
  actions?: Snippet | string
  /** Optional metadata row rendered below the main row — a snippet or a plain string. */
  meta?: Snippet | string
  /** Optional search slot (rendered to the left of the actions) — a snippet or a plain string. */
  search?: Snippet | string
  /** Whether to render with a sticky-top style (position: sticky). */
  sticky?: boolean
  /** Extra classes. */
  className?: string
  /** `data-mol-id` for AI-agent selectors. */
  dataMolId?: string
}

Constants

DetailHeader

const DetailHeader: LegacyComponentType

Injection Notes

Requirements

Peer dependencies:

  • @molecule/app-svelte ^3.13.0 || ^4.0.0
  • @molecule/app-ui ^1.0.1
  • @molecule/app-ui-svelte ^1.1.0
  • svelte ^5.0.0

Runtime Dependencies

  • @molecule/app-svelte

  • @molecule/app-ui

  • @molecule/app-ui-svelte

  • svelte

  • sticky applies position: sticky; top: 0 but adds NO background — pass a surface class via className (e.g. your ClassMap's surface helper) or content will scroll visibly through the header.

  • There is no breadcrumb prop; put a breadcrumb in the leading snippet or render one above the header (see @molecule/app-detail-page-layout-react, which has a breadcrumb slot).

  • Styling resolves through getClassMap() — requires a wired ClassMap bond (standard molecule app setup). No text of its own, so no locale bond is needed; translate the values you pass in.