@molecule/app-section-divider-vue
Feature · section-divider · App (browser) · v1.1.2 · Apache-2.0
Centered-label section divider ("OR", "Today") with flanking lines
npm install @molecule/app-section-divider-vueHow it works
@molecule/app-section-divider-vue is a ready-made section-divider 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 { SectionDivider } from '@molecule/app-section-divider-vue'
const App = defineComponent({
setup() {
return () => [
h(SectionDivider, () => 'OR'),
h(SectionDivider, { align: 'start' }, { default: () => 'Today' }),
]
},
})
createApp(App).mount('#app')Works with: @molecule/app-ui, @molecule/app-ui-vue, @molecule/app-vue
Reference
Vue horizontal divider with optional centered label.
Exports <SectionDivider> — the Vue counterpart of
@molecule/app-section-divider-react: same props, same DOM for the same
input. The label is your own slot content — translate it upstream.
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 { SectionDivider } from '@molecule/app-section-divider-vue'
const App = defineComponent({
setup() {
return () => [
h(SectionDivider, () => 'OR'),
h(SectionDivider, { align: 'start' }, { default: () => 'Today' }),
]
},
})
createApp(App).mount('#app')
Type
feature
Installation
npm install @molecule/app-section-divider-vue @molecule/app-ui @molecule/app-ui-vue @molecule/app-vue vue
API
Interfaces
SectionDividerProps
Props accepted by the SectionDivider component.
interface SectionDividerProps {
/** Centered label text — the DEFAULT slot. Translate it upstream. */
children?: VNodeChild
/** Where to align the label. Defaults to `'center'`. */
align?: 'start' | 'center' | 'end'
/** Extra classes. */
className?: string
}
Constants
SectionDivider
Horizontal divider with an optional centered label, common as "OR" between auth options, "Today" between feed days, "—" between sections.
The label is the default slot; align positions it: 'center' (default)
draws lines on both sides, 'start' / 'end' put the label at that edge
with a single line filling the rest. The frame and lines use ClassMap
tokens (cm.flex, cm.flex1, cm.textSize, cm.fontWeight) so the
styling library can be swapped without touching consumers.
const SectionDivider: DefineComponent<
ExtractPropTypes<{
align: { type: PropType<'start' | 'center' | 'end'>; default: string }
className: StringConstructor
}>,
() => VNode,
{},
{},
{},
ComponentOptionsMixin,
ComponentOptionsMixin,
{},
string,
PublicProps,
Readonly<
ExtractPropTypes<{
align: { type: PropType<'start' | 'center' | 'end'>; default: string }
className: StringConstructor
}>
> &
Readonly<{}>,
{ align: 'start' | 'center' | 'end' },
{},
{},
{},
string,
ComponentProvideOptions,
true,
{},
any
>
props— Component props (seeSectionDividerProps).
Returns: The section divider 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 -
Requires a bonded ClassMap (frame uses
cm.flex, lines usecm.flex1) — rendering throws otherwise. No i18n dependency (the label is your own slot content — translate it upstream). -
alignpositions the label:'center'(default) draws lines on both sides;'start'/'end'put the label at that edge with a single line filling the rest. -
Lines use
currentColorat 20% opacity, so they inherit the local text color in both light and dark themes.