@molecule/app-page-chrome-vue
Feature · page-chrome · App (browser) · v1.1.2 · Apache-2.0
Vue page-header / hero-section primitives for SaaS apps
npm install @molecule/app-page-chrome-vueHow it works
@molecule/app-page-chrome-vue is a ready-made page-chrome 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, ref } from 'vue'
import { HeroSection, PageHeader } from '@molecule/app-page-chrome-vue'
import { Button } from '@molecule/app-ui-vue'
const ProjectsPage = defineComponent({
setup() {
const open = ref(false)
return () =>
h('div', [
h(
PageHeader,
{
title: 'Projects',
subtitle: 'Manage your active projects',
},
{
actions: () => [h(Button, { onClick: () => (open.value = true) }, () => 'New project')],
},
),
h(
HeroSection,
{
eyebrow: 'Welcome back',
title: 'Your workspace',
description: 'Everything you need to ship faster.',
},
{
primaryAction: () => [h(Button, { variant: 'solid' }, () => 'Get started')],
},
),
])
},
})
createApp(ProjectsPage).mount('#app')Works with: @molecule/app-ui, @molecule/app-ui-vue, @molecule/app-vue
Reference
Vue page-header and hero-section primitives — the Vue counterpart of
@molecule/app-page-chrome-react: the same props (React names), the same
DOM for the same input.
Exports:
<PageHeader>— top-of-page header with breadcrumbs + title/subtitle + leading icon + right-aligned actions + meta row.emphasis="extrabold"switches the title to the larger dashboard treatment.<HeroSection>— dashboard/landing hero with text + optional media column;align="center"for marketing-style heroes.
Both accept className for per-brand accent styling and dataMolId for
AI-agent selectors. Node-valued props arrive as a prop AND as a same-named
slot; components accept either.
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, ref } from 'vue'
import { HeroSection, PageHeader } from '@molecule/app-page-chrome-vue'
import { Button } from '@molecule/app-ui-vue'
const ProjectsPage = defineComponent({
setup() {
const open = ref(false)
return () =>
h('div', [
h(
PageHeader,
{
title: 'Projects',
subtitle: 'Manage your active projects',
},
{
actions: () => [h(Button, { onClick: () => (open.value = true) }, () => 'New project')],
},
),
h(
HeroSection,
{
eyebrow: 'Welcome back',
title: 'Your workspace',
description: 'Everything you need to ship faster.',
},
{
primaryAction: () => [h(Button, { variant: 'solid' }, () => 'Get started')],
},
),
])
},
})
createApp(ProjectsPage).mount('#app')
Type
feature
Installation
npm install @molecule/app-page-chrome-vue @molecule/app-ui @molecule/app-ui-vue @molecule/app-vue vue
API
Interfaces
PageHeaderProps
Props accepted by the PageHeader component.
interface PageHeaderProps {
/** Primary heading (usually `t('...')`). Passed as a prop or as the same-named slot. */
title?: VNodeChild
/** Optional subheading rendered below the title. Prop or same-named slot. */
subtitle?: VNodeChild
/** Optional leading icon next to the title. Prop or same-named slot. */
icon?: VNodeChild
/** Optional breadcrumb trail rendered above the title row. Prop or same-named slot. */
breadcrumbs?: VNodeChild
/** Right-aligned actions (buttons, menus, etc.). Prop or same-named slot. */
actions?: VNodeChild
/** Optional meta row rendered below the title/subtitle. Prop or same-named slot. */
meta?: VNodeChild
/**
* Title emphasis level. Both values resolve their weight through
* `cm.fontWeight(...)`, so the class is a real, theme-scanned utility.
* - `'normal'` (default) — 3xl `cm.fontWeight('bold')`, for general /
* reusable list-page headers.
* - `'extrabold'` — the larger 4xl `cm.fontWeight('extrabold')` dashboard
* treatment (`font-extrabold` is safelisted by `@molecule/app-ui-tailwind`'s
* base.css, so it always generates).
*/
emphasis?: 'normal' | 'extrabold'
/** `data-mol-id` for AI-agent selectors. */
dataMolId?: string
/** Extra classes on the outer wrapper. */
className?: string
}
HeroSectionProps
Props accepted by the HeroSection component.
interface HeroSectionProps {
/** Small eyebrow line above the headline. Prop or same-named slot. */
eyebrow?: VNodeChild
/** Primary headline. Prop or same-named slot. */
title?: VNodeChild
/** Supporting description. Prop or same-named slot. */
description?: VNodeChild
/** Primary call-to-action. Prop or same-named slot. */
primaryAction?: VNodeChild
/** Optional secondary call-to-action. Prop or same-named slot. */
secondaryAction?: VNodeChild
/** Optional visual / illustration slot, positioned to the right at md+. Prop or same-named slot. */
media?: VNodeChild
/** Horizontal alignment — defaults to `start`. */
align?: 'start' | 'center'
/** Extra classes. */
className?: string
/** `data-mol-id` for AI-agent selectors. */
dataMolId?: string
}
Constants
HeroSection
Dashboard / landing hero. Text column on the left, optional media on
the right. Alignment defaults to start for dashboards; use
align="center" for marketing-style landing heroes.
const HeroSection: DefineComponent<
ExtractPropTypes<{
eyebrow: null
title: null
description: null
primaryAction: null
secondaryAction: null
media: null
align: { type: PropType<'start' | 'center'>; default: string }
className: StringConstructor
dataMolId: StringConstructor
}>,
() => VNode,
{},
{},
{},
ComponentOptionsMixin,
ComponentOptionsMixin,
{},
string,
PublicProps,
Readonly<
ExtractPropTypes<{
eyebrow: null
title: null
description: null
primaryAction: null
secondaryAction: null
media: null
align: { type: PropType<'start' | 'center'>; default: string }
className: StringConstructor
dataMolId: StringConstructor
}>
> &
Readonly<{}>,
{ align: 'start' | 'center' },
{},
{},
{},
string,
ComponentProvideOptions,
true,
{},
any
>
props— Component props (seeHeroSectionProps).
Returns: The hero section component.
PageHeader
Standard page-top header with optional breadcrumbs, leading icon, title / subtitle pair, meta row, and right-aligned actions.
Layout: breadcrumbs, then a two-column row with title+subtitle on the left and actions on the right, then optional meta.
const PageHeader: DefineComponent<
ExtractPropTypes<{
title: null
subtitle: null
icon: null
breadcrumbs: null
actions: null
meta: null
emphasis: { type: PropType<'normal' | 'extrabold'>; default: string }
dataMolId: StringConstructor
className: StringConstructor
}>,
() => VNode,
{},
{},
{},
ComponentOptionsMixin,
ComponentOptionsMixin,
{},
string,
PublicProps,
Readonly<
ExtractPropTypes<{
title: null
subtitle: null
icon: null
breadcrumbs: null
actions: null
meta: null
emphasis: { type: PropType<'normal' | 'extrabold'>; default: string }
dataMolId: StringConstructor
className: StringConstructor
}>
> &
Readonly<{}>,
{ emphasis: 'normal' | 'extrabold' },
{},
{},
{},
string,
ComponentProvideOptions,
true,
{},
any
>
props— Component props (seePageHeaderProps).
Returns: The page 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-vuevue
Not to be confused with @molecule/app-ui-vue's own <PageHeader>
(props: title/description/actions/breadcrumbs): THIS PageHeader
takes subtitle (not description) and adds icon, meta, and
emphasis. Import from the package that matches the props you pass.
Styling resolves via getClassMap() from @molecule/app-ui, so a ClassMap
bond (e.g. @molecule/app-ui-tailwind) must be wired before render.