Title

Data Display
stable

Polymorphic heading with configurable tag (h1–h6 or any block element) and density-driven typography tokens.

Structure

Anatomy

Visual breakdown of the component's internal structure with BEM class call-outs.

Anatomy of OrigamTitleSchematic of the Title component — single root element with density class. Page Title 1 origam-title (tag=h1 default) density: compact → xs · default → md · comfortable → xl
Anatomy of <origam-title> — a single polymorphic element ①. Font size is controlled by density via three token tiers.
1.origam-title
Root element. Renders as

by default (overridable via tag prop). Uses vContrast directive for automatic text color contrast. Three density modifier classes control font size: --density-compact, --density-default, --density-comfortable.

API

Props

All props accepted by this component, with their type, default value and description.

text
string
Heading text content. Can also be set via the default slot.
tag
string
'h1'
HTML heading element rendered at root. Defaults to h1. Use 'h2' through 'h6' to set the correct document hierarchy.
id
string
class
string | Array<string> | object
style
string | Array<string> | object | StyleValue
color
Foreground (text) color. Accepts semantic intents or a CSS color.
bgColor
Background color override.
density
'default'
Controls font size via token tiers. 'compact' → font-size-xs, 'default' → font-size-md, 'comfortable' → font-size-xl.
padding
boolean | number | string
CSS padding shorthand applied via the padding composable.
paddingTop
boolean | number | string
paddingLeft
boolean | number | string
paddingBottom
boolean | number | string
paddingRight
boolean | number | string
paddingBlock
boolean | number | string
paddingInline
boolean | number | string
paddingInlineStart
boolean | number | string
paddingInlineEnd
boolean | number | string
paddingBlockStart
boolean | number | string
paddingBlockEnd
boolean | number | string
margin
boolean | number | string
CSS margin shorthand applied via the margin composable.
marginTop
boolean | number | string
marginLeft
boolean | number | string
marginBottom
boolean | number | string
marginRight
boolean | number | string
marginBlock
boolean | number | string
marginInline
boolean | number | string
marginInlineStart
boolean | number | string
marginInlineEnd
boolean | number | string
marginBlockStart
boolean | number | string
marginBlockEnd
boolean | number | string
border
boolean | number | string | TDirectionBoth | Array<TDirectionBoth>
false
Applies a border to the heading element.
borderTop
boolean | number | string
borderLeft
boolean | number | string
borderBottom
boolean | number | string
borderRight
boolean | number | string
borderBlock
boolean | number | string
borderInline
boolean | number | string
borderInlineStart
boolean | number | string
borderInlineEnd
boolean | number | string
borderBlockStart
boolean | number | string
borderBlockEnd
boolean | number | string
borderColor
string
borderStyle
string
borderTopColor
TColor
borderRightColor
TColor
borderBottomColor
TColor
borderLeftColor
TColor
borderInlineStartColor
TColor
borderInlineEndColor
TColor
borderBlockStartColor
TColor
borderBlockEndColor
TColor
fontFamily
TFontFamily
fontSize
TFontSize
fontWeight
TFontWeight
lineHeight
TLineHeight
letterSpacing
TLetterSpacing
fontStyle
string
textTransform
TTextTransform

API

Slots

Content slots exposed by this component.

#default
Heading content. Overrides the text prop. Accepts rich markup (inline elements, nested spans, etc.).

API

Exposed members

Properties and methods accessible via template ref (defineExpose). Use them for programmatic control.

<T extends object>(props: T, exclude?: string[]) => Partial<T>
Utility to forward a filtered subset of props to a child component.
Ref<string>
Reactive CSS string generated by useStyle.
string
Unique style-sheet ID (aliased to styleId internally to avoid shadowing the id prop).
() => void
Injects the computed style sheet into the document.
() => void
Removes the injected style sheet.
Ref<boolean>
True once the style sheet has been injected into the DOM.

Customisation

CSS variables

CSS custom properties exposed by this component. Override them to customise the component without losing theme compatibility.

Default heading text color.
Heading font family.
Heading font weight.
Heading letter-spacing.
Heading line-height.
Font size for density="compact".
Font size for density="default".
Font size for density="comfortable".
Top margin override (zeroed by default — control spacing via the margin prop).
Bottom margin override (zeroed by default).

Inclusion

Accessibility

ARIA roles, keyboard navigation and focus management. Sourced from the real component template.

ARIA roles

heading (native HTML)

Notes

  • Always choose a tag value that fits the document heading hierarchy (h1 for the page title, h2 for sections, etc.). Skipping heading levels (h1 → h3) impairs screen reader navigation.
  • The vContrast directive automatically adjusts the text color for sufficient contrast against the background. Do not suppress it without verifying WCAG AA compliance manually.
  • When setting color or bgColor, verify that the contrast ratio meets WCAG 2.1 AA (≥ 4.5:1 for normal text). The vContrast directive assists but does not guarantee compliance for every color combination.

Foundation

Design tokens

Excerpt from this component's token declarations — the --origam-<component>---<property> variables, declared in its hand-maintained token sheet with no build step.

Source
color
var(--origam-color__text---primary)
Default heading text color.
fontFamily
var(--origam-font__family---sans)
Heading font family.
fontWeight
var(--origam-font__weight---semibold)
Heading font weight.
dimension
var(--origam-font__size---xl)
Font size for density=default.
dimension
var(--origam-font__size---3xl)
Font size for density=comfortable.
dimension
var(--origam-font__size---md)
Font size for density=compact.
dimension
var(--origam-font__letterSpacing---tight)
Heading letter-spacing.

Interactive

Playground

Edit props live and see the component update in real time. The generated code snippet updates as you change values.

Rendering the live preview…

Usage

Examples

Ready-to-paste code snippets for your templates.

Heading levels

vue

Density (font size)

vue

Colors

vue