<content-text-block>
A block of text with its alignment, vertical position and minimum height set per breakpoint.
import '@content-blocks/js/components/content-text-block';Examples
Centred introduction
An eyebrow, a heading and a button, centred, with the line length limited by content-line.
<content-text-block text-align="center" padding="2rem 1.25rem">
<content-line tag="h4">Prophecy</content-line>
<content-line tag="h3" max-width="320px" padding="0.4rem 0 1rem">The hero returns before the final winter</content-line>
<content-button href="#">Read the saga →</content-button>
</content-text-block>h3 {
font-size: 1.5rem;
font-weight: 700;
}
content-text-block {
background: #f1f5f9;
}
h4 {
font-size: 0.75rem;
font-weight: 700;
}
a {
font-weight: 600;
color: inherit;
}// $ npm install @content-blocks/js
import '@content-blocks/js/components/content-text-block';
import '@content-blocks/js/components/content-line';
import '@content-blocks/js/components/content-button';<script type="module"
src="https://cdn.jsdelivr.net/npm/@content-blocks/js/dist/content-blocks/content-blocks.esm.js"></script>Pinned to the bottom
min-height and vertical="bottom" pin the text to the foot of a dark card.
<content-text-block min-height="240px" vertical="bottom" padding="1.5rem">
<content-line tag="p">3</content-line>
<content-line tag="p" padding="0.5rem 0 0">Winters without a summer. The end is near.</content-line>
</content-text-block>content-text-block {
color: #fff;
background: #0f172a;
}
content-line:first-child {
font-size: 3rem;
font-weight: 800;
color: #60a5fa;
}// $ npm install @content-blocks/js
import '@content-blocks/js/components/content-text-block';
import '@content-blocks/js/components/content-line';<script type="module"
src="https://cdn.jsdelivr.net/npm/@content-blocks/js/dist/content-blocks/content-blocks.esm.js"></script>Pull quote
A large serif quote and its author, with a rule down the side.
“When the wolf swallows the sun, look to the north road. The Warden will come.”
<content-text-block padding="0 0 0 1.25rem">
<blockquote>“When the wolf swallows the sun, look to the north road. The Warden will come.”</blockquote>
<content-line tag="p" padding="0.75rem 0 0">The seeress of the fjords</content-line>
</content-text-block>content-text-block {
border-left: 3px solid #1d4ed8;
}
blockquote {
font-family: Georgia, serif;
font-size: 1.35rem;
}// $ npm install @content-blocks/js
import '@content-blocks/js/components/content-text-block';
import '@content-blocks/js/components/content-line';<script type="module"
src="https://cdn.jsdelivr.net/npm/@content-blocks/js/dist/content-blocks/content-blocks.esm.js"></script>Anatomy
Content goes into the component's slots, chosen with the slot attribute on each child.
flowchart LR root["#lt;content-text-block#gt;"]:::component root --> s0["<b>no slot (default)</b><br/>Default slot, same as content slot"] root --> s1["<b>slot=#quot;content#quot;</b><br/>This slot will usually serve a text block."] root --> s2["<b>slot=#quot;footer#quot;</b><br/>This slot is placed below the content slot"] classDef component fill:#141413,color:#faf9f5,stroke:#141413
| Slot | What goes in it |
|---|---|
(default) | Default slot, same as content slot |
slot="content" | This slot will usually serve a text block. |
slot="footer" | This slot is placed below the content slot |
Properties
Set them as attributes. Those marked responsive take a value per breakpoint, separated by pipes and named or in order: 1|tablet=2 or 1|2. Seeresponsive values.
| Attribute | Type | Default | Description |
|---|---|---|---|
classesresponsive | String | – | Classes to add to the component. Use pipes for different classes per breakpoint, by name or in order: classes="stacked|laptop=side-by-side". |
full-heightresponsive | Boolean | 'false' | Not documented yet |
min-heightresponsive | String | – | This is a pipe separated string representing the minimum height. Units without values default to pixels. |
paddingresponsive | String | – | Padding around the component, written as CSS padding. Use pipes for different padding per breakpoint, by name or in order: padding="1rem|tablet=2rem 4rem" or padding="1rem|2rem 4rem|3rem 5rem 4rem". |
text-alignresponsive | Select | 'default' | Pipe separated list of ContentLineTextAlignOptions for text alignment. |
verticalresponsive | Select | 'top' | Pipe separated list of ContentVerticalAlignments for text box placement. |


