Skip to content
Content Blocks docsv0.8.0Website

Docs / Blocks

<content-text-block>

A block of text with its alignment, vertical position and minimum height set per breakpoint.

Import it on its own, for a bundler
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.

Open on its own
Prophecy The hero returns before the final winter Read the saga →

Pinned to the bottom

min-height and vertical="bottom" pin the text to the foot of a dark card.

Open on its own
3 Winters without a summer. The end is near.

Pull quote

A large serif quote and its author, with a rule down the side.

Open on its own
“When the wolf swallows the sun, look to the north road. The Warden will come.”
The seeress of the fjords

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
The slots of <content-text-block>
SlotWhat 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.

AttributeTypeDefaultDescription
classesresponsiveString–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-heightresponsiveBoolean'false'Not documented yet
min-heightresponsiveString–This is a pipe separated string representing the minimum height. Units without values default to pixels.
paddingresponsiveString–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-alignresponsiveSelect

default · left · center · right

'default'Pipe separated list of ContentLineTextAlignOptions for text alignment.
verticalresponsiveSelect

top · center · bottom

'top'Pipe separated list of ContentVerticalAlignments for text box placement.