Title
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.
<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.
- textstring
- Heading text content. Can also be set via the default slot.
- tagstring'h1'
- HTML heading element rendered at root. Defaults to h1. Use 'h2' through 'h6' to set the correct document hierarchy.
- idstring
- classstring | Array<string> | object
- stylestring | Array<string> | object | StyleValue
- color
- Foreground (text) color. Accepts semantic intents or a CSS color.
- bgColor
- Background color override.
- Controls font size via token tiers. 'compact' → font-size-xs, 'default' → font-size-md, 'comfortable' → font-size-xl.
- paddingboolean | number | string
- CSS padding shorthand applied via the padding composable.
- paddingTopboolean | number | string
- paddingLeftboolean | number | string
- paddingBottomboolean | number | string
- paddingRightboolean | number | string
- paddingBlockboolean | number | string
- paddingInlineboolean | number | string
- paddingInlineStartboolean | number | string
- paddingInlineEndboolean | number | string
- paddingBlockStartboolean | number | string
- paddingBlockEndboolean | number | string
- marginboolean | number | string
- CSS margin shorthand applied via the margin composable.
- marginTopboolean | number | string
- marginLeftboolean | number | string
- marginBottomboolean | number | string
- marginRightboolean | number | string
- marginBlockboolean | number | string
- marginInlineboolean | number | string
- marginInlineStartboolean | number | string
- marginInlineEndboolean | number | string
- marginBlockStartboolean | number | string
- marginBlockEndboolean | number | string
- borderboolean | number | string | TDirectionBoth | Array<TDirectionBoth>false
- Applies a border to the heading element.
- borderTopboolean | number | string
- borderLeftboolean | number | string
- borderBottomboolean | number | string
- borderRightboolean | number | string
- borderBlockboolean | number | string
- borderInlineboolean | number | string
- borderInlineStartboolean | number | string
- borderInlineEndboolean | number | string
- borderBlockStartboolean | number | string
- borderBlockEndboolean | number | string
- borderColorstring
- borderStylestring
- borderTopColorTColor
- borderRightColorTColor
- borderBottomColorTColor
- borderLeftColorTColor
- borderInlineStartColorTColor
- borderInlineEndColorTColor
- borderBlockStartColorTColor
- borderBlockEndColorTColor
- fontFamilyTFontFamily
- fontSizeTFontSize
- fontWeightTFontWeight
- lineHeightTLineHeight
- letterSpacingTLetterSpacing
- fontStylestring
- textTransformTTextTransform
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
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.
- colorvar(--origam-color__text---primary)
- Default heading text color.
- fontFamilyvar(--origam-font__family---sans)
- Heading font family.
- fontWeightvar(--origam-font__weight---semibold)
- Heading font weight.
- dimensionvar(--origam-font__size---xl)
- Font size for density=default.
- dimensionvar(--origam-font__size---3xl)
- Font size for density=comfortable.
- dimensionvar(--origam-font__size---md)
- Font size for density=compact.
- dimensionvar(--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
Density (font size)
Colors