@molecule/app-detail-header-vue
Feature · detail-header · App (browser) · v1.1.2 · Apache-2.0
Detail-page top bar with title, subtitle, status, actions, breadcrumb, optional search
npm install @molecule/app-detail-header-vueHow it works
@molecule/app-detail-header-vue 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.
import { createApp, defineComponent, h } from 'vue'
import { DetailHeader } from '@molecule/app-detail-header-vue'
import { Button } from '@molecule/app-ui-vue'
import { StatusBadge } from '@molecule/app-status-badge-vue'
const App = defineComponent({
setup() {
return () =>
h(DetailHeader, {
title: 'Project Alpha',
subtitle: 'Last updated 2 hours ago',
status: h(StatusBadge, { kind: 'success' }, () => ['Active']),
actions: h(Button, { variant: 'solid', onClick: handleEdit }, () => ['Edit']),
meta: h('span', 'Owner: Alice'),
sticky: true,
})
},
})
createApp(App).mount('#app')Works with: @molecule/app-ui, @molecule/app-ui-vue, @molecule/app-vue
Reference
Vue detail-page header.
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 node props or same-named slots — compose any
components. It is the Vue counterpart of
@molecule/app-detail-header-react: same props and the same DOM for the
same input.
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.tsJSDoc, not this file.
Quick Start
import { createApp, defineComponent, h } from 'vue'
import { DetailHeader } from '@molecule/app-detail-header-vue'
import { Button } from '@molecule/app-ui-vue'
import { StatusBadge } from '@molecule/app-status-badge-vue'
const App = defineComponent({
setup() {
return () =>
h(DetailHeader, {
title: 'Project Alpha',
subtitle: 'Last updated 2 hours ago',
status: h(StatusBadge, { kind: 'success' }, () => ['Active']),
actions: h(Button, { variant: 'solid', onClick: handleEdit }, () => ['Edit']),
meta: h('span', 'Owner: Alice'),
sticky: true,
})
},
})
createApp(App).mount('#app')
Type
feature
Installation
npm install @molecule/app-detail-header-vue @molecule/app-ui @molecule/app-ui-vue @molecule/app-vue vue
API
Interfaces
DetailHeaderProps
Props accepted by the DetailHeader component.
interface DetailHeaderProps {
/** Primary heading. Passed as a prop or as the same-named slot — both work. */
title: VNodeChild
/** Optional subtitle shown below the title. Passed as a prop or a slot. */
subtitle?: VNodeChild
/** Optional leading avatar / icon / logo. Passed as a prop or a slot. */
leading?: VNodeChild
/** Optional status indicator (e.g. `<StatusBadge>` or `<StatusPill>`). Passed as a prop or a slot. */
status?: VNodeChild
/** Right-aligned actions. Passed as a prop or a slot. */
actions?: VNodeChild
/** Optional metadata row rendered below the main row (chips / secondary fields). Passed as a prop or a slot. */
meta?: VNodeChild
/** Optional search slot (rendered to the left of the actions). Passed as a prop or a slot. */
search?: VNodeChild
/** 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
Header row for a detail page — leading slot + title/subtitle + status + actions, with optional meta row and search slot.
Different from <PageHeader> (used at the top of list/index pages)
in prioritising status + search + stickiness.
const DetailHeader: DefineComponent<
ExtractPropTypes<{
title: null
subtitle: null
leading: null
status: null
actions: null
meta: null
search: null
sticky: { type: PropType<boolean>; default: undefined }
className: { type: StringConstructor; default: undefined }
dataMolId: { type: StringConstructor; default: undefined }
}>,
() => VNode,
{},
{},
{},
ComponentOptionsMixin,
ComponentOptionsMixin,
{},
string,
PublicProps,
Readonly<
ExtractPropTypes<{
title: null
subtitle: null
leading: null
status: null
actions: null
meta: null
search: null
sticky: { type: PropType<boolean>; default: undefined }
className: { type: StringConstructor; default: undefined }
dataMolId: { type: StringConstructor; default: undefined }
}>
> &
Readonly<{}>,
{ sticky: boolean; className: string; dataMolId: string },
{},
{},
{},
string,
ComponentProvideOptions,
true,
{},
any
>
props— Component props (seeDetailHeaderProps).
Returns: The detail header component.
Injection Notes
Requirements
Peer dependencies:
@molecule/app-ui^1.0.1@molecule/app-ui-vue^1.1.0@molecule/app-vue^3.13.0 || ^4.0.0vue^3.4.0
Runtime Dependencies
-
@molecule/app-ui -
@molecule/app-ui-vue -
@molecule/app-vue -
vue -
stickyappliesposition: sticky; top: 0but adds NO background — pass a surface class viaclassName(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
leadingslot or render one above the header (see@molecule/app-detail-page-layout-react, which has a breadcrumb slot). -
Node-valued props arrive as a prop AND a same-named slot; components accept either.
-
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.