CardText

Surface
stable

Card body text section. A flex-grow container with density-aware padding and body typography defaults.

Preview

Rendering the live preview…

with text prop

Rendering the live preview…

compact density

Rendering the live preview…

comfortable density

Structure

Anatomy

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

Anatomy of OrigamCardTextSchematic of the CardText component with 2 numbered parts. Body text or #default slot content font-size: 0.875rem · flex: 1 1 auto 1 2 origam-card-text
Anatomy of <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.

text
string | number
Text content rendered inside a <span>. Overridable with the #default slot for richer content.
id
string
class
string | Array<string> | object
style
string | Array<string> | object | StyleValue
tag
string
'div'
HTML element rendered at the root. Defaults to <div>; can be changed to <p>, <section>, etc.
border
boolean | number | string | TDirectionBoth | Array<TDirectionBoth>
false
Applies a border to the text container.
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
Border-radius for the text container.
roundedTopRight
boolean | number | string
roundedTopLeft
boolean | number | string
roundedBottomLeft
boolean | number | string
roundedBottomRight
boolean | number | string
roundedStartStart
boolean | number | string
roundedStartEnd
boolean | number | string
roundedEndStart
boolean | number | string
roundedEndEnd
boolean | number | string
padding
boolean | number | string
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
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
density
'default'
Density modifier adjusting the block and inline padding via --origam-card-text---density.
fontSize
TFontSize
fontWeight
TFontWeight
letterSpacing
TLetterSpacing

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

vue

Rich slot content

vue

Compact density

vue

Ecosystem

Family

Components from the same folder that share conventions and often compose together.