The Text component renders configurable heading and text elements with dynamic styling. It supports different heading levels (h1-h6) or plain text, with styling controlled through CMS display settings for maximum flexibility.
The Text component is used for headlines, subheadings, labels, and any text that requires specific typography treatment or semantic heading structure.
- Content: The text content to display
- Heading Type: Heading 1-6, Plain text
- Text Align: Left, Center, Right, Justify
- Render As: Heading element, Basic element
- Text Transform: As entered, Uppercase, Lowercase, Capitalize
[Placeholder for Text component screenshot showing different heading levels and styles]
Text.astro- Main component implementationtext.graphql- GraphQL fragment for component dataTextStyling.ts- Style configuration utilitiesTextStyles.opti-style.json- CMS style configuration
- Dynamically renders appropriate HTML element based on settings
- Uses Astro's component interpolation for element type selection
- Supports full spectrum of heading semantics (h1-h6)
- Falls back to span for non-semantic text styling
- Style system allows complete customization without code changes
- Maintains proper accessibility with semantic heading structure
- Clean separation between content and presentation
- Lightweight implementation with powerful configuration options