Title

Data Display
stable

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

Structure

Anatomie

Décomposition visuelle de la structure interne du composant avec les appels de classes BEM.

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

Toutes les props acceptées par ce composant, avec leur type, valeur par défaut et 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

Emplacements de contenu exposés par ce composant.

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

API

Membres exposés

Propriétés et méthodes accessibles via ref template (defineExpose). Utilisés pour le contrôle programmatique.

<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.

Personnalisation

Variables CSS

Propriétés CSS personnalisées exposées par ce composant. Surchargez-les pour personnaliser sans perdre la compatibilité avec le thème.

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

Accessibilité

Rôles ARIA, navigation clavier et gestion du focus. Sourcé depuis le template réel du composant.

Rôles ARIA

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.

Fondation

Design tokens

Extrait des tokens de ce composant — les variables --origam-<composant>---<propriété>, déclarées dans sa feuille de tokens tenue à la main, sans étape de build.

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.

Interactif

Playground

Modifiez les props en direct et observez le composant se mettre à jour. Le snippet de code généré suit vos changements.

Rendu de l’aperçu en cours…

Usage

Exemples

Extraits de code prêts à coller dans vos templates.

Heading levels

vue

Density (font size)

vue

Colors

vue