CardText
Card body text section. A flex-grow container with density-aware padding and body typography defaults.
Preview
Rendering the live preview…
with text propRendering the live preview…
compact densityRendering the live preview…
comfortable densityStructure
Anatomy
Visual breakdown of the component's internal structure with BEM class call-outs.
<origam-card-text> — root container ① (flex: 1 1 auto) with density-aware padding ② wrapping the body text or #default slot.- 1.origam-card-text
- Root element (default:
<div>). flex: 1 1 auto so it fills available card height. font-size: 0.875rem, font-weight: 400. Padding is density-adjusted. - 2(content / #default slot)
- Inner content: renders
<span>{{ text }}</span>when the text prop is provided, or the #default slot for richer content.
API
Props
All props accepted by this component, with their type, default value and description.
- textstring | number
- Text content rendered inside a <span>. Overridable with the #default slot for richer content.
- idstring
- classstring | Array<string> | object
- stylestring | Array<string> | object | StyleValue
- tagstring'div'
- HTML element rendered at the root. Defaults to <div>; can be changed to <p>, <section>, etc.
- borderboolean | number | string | TDirectionBoth | Array<TDirectionBoth>false
- Applies a border to the text container.
- 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
- Border-radius for the text container.
- roundedTopRightboolean | number | string
- roundedTopLeftboolean | number | string
- roundedBottomLeftboolean | number | string
- roundedBottomRightboolean | number | string
- roundedStartStartboolean | number | string
- roundedStartEndboolean | number | string
- roundedEndStartboolean | number | string
- roundedEndEndboolean | number | string
- paddingboolean | number | string
- 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
- 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
- Density modifier adjusting the block and inline padding via --origam-card-text---density.
- fontSizeTFontSize
- fontWeightTFontWeight
- letterSpacingTLetterSpacing
API
Slots
Content slots exposed by this component.
- #default
- Overrides the text prop. Use for rich HTML content (paragraphs, lists, etc.) inside the card body.
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 child components.
- Ref<string>
- Reactive CSS string generated by useStyle from the computed cardTextStyles.
- string
- Unique style-sheet ID for this instance.
- () => 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.
- Flex grow/shrink/basis for the text area. 1 1 auto ensures it fills available vertical space.
- Body text font size (0.875rem = 14px).
- Body text font weight (normal).
- Letter spacing applied to body text.
- Block-start padding (density-adjusted at render time).
- Block-end padding (density-adjusted).
- Inline-start padding (density-adjusted).
- Inline-end padding (density-adjusted).
- Density offset added to all four padding values. compact: −8px, default: 0px, comfortable: +8px.
Inclusion
Accessibility
ARIA roles, keyboard navigation and focus management. Sourced from the real component template.
Notes
- OrigamCardText renders as a <div> by default. When the content is a paragraph of text, consider passing tag="p" or wrapping inner content in <p> tags for correct semantics. Avoid placing block-level elements inside a <p> tag if you change the root tag.
- CardText is not interactive and does not receive focus. Interactive elements inside the text (links, buttons) manage their own focus and keyboard interaction.
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.
Basic card text
Rich slot content
Compact density
Ecosystem
Family
Components from the same folder that share conventions and often compose together.