CardText
Card body text section. A flex-grow container with density-aware padding and body typography defaults.
Aperçu
Rendu de l’aperçu en cours…
with text propRendu de l’aperçu en cours…
compact densityRendu de l’aperçu en cours…
comfortable densityStructure
Anatomie
Décomposition visuelle de la structure interne du composant avec les appels de classes BEM.
<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
Toutes les props acceptées par ce composant, avec leur type, valeur par défaut et 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
Emplacements de contenu exposés par ce composant.
- #default
- Overrides the text prop. Use for rich HTML content (paragraphs, lists, etc.) inside the card body.
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 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.
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.
- 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
Accessibilité
Rôles ARIA, navigation clavier et gestion du focus. Sourcé depuis le template réel du composant.
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.
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.
Basic card text
Rich slot content
Compact density
Écosystème
Famille
Composants du même dossier qui partagent les conventions et se composent souvent ensemble.