Title
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.
<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.
- 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
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
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.
- 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.
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
Density (font size)
Colors