AlignChildToText
Component that uses a zero-width space to vertically align a child element such as an icon with a line of text. This is especially useful when text needs to wrap.
Quick Start
- Installation
npm install @adaptavant/eds-core- Import
import { AlignChildToText } from '@adaptavant/eds-core';
Icon inside text
Anywhere is the freedom to boldly go... well,
Anywhere; untethered from geographic constraints and free to think outside the cubicle.
Anywhere; untethered from geographic constraints and free to think outside the cubicle.
<Track
className="p-4"
railStart={
<AlignChildToText>
<MapPinIcon size="32" />
</AlignChildToText>
}
verticalAlign="top"
>
Anywhere is the freedom to boldly go... well, <br />
Anywhere; untethered from geographic constraints and free to think outside the
cubicle.
</Track>
API Reference
AlignChildToText
| Prop | Default | Description |
|---|---|---|
as? | 'span' | React.ElementTypeThe element type to render. |
children | _ | React.ReactNodeThe content that aligns with text. |
className? | '' | stringCSS class names to apply to the root element. |
style? | {} | React.CSSPropertiesInline styles to apply to the root element. |