{% include '@bolt-elements-type/type.twig' with {
content: 'This is a type element.'
} only %}
Prop Name | Description | Type | Default Value | Option(s) |
---|---|---|---|---|
attributes
|
A Drupal-style attributes object with extra attributes to append to this element. |
object
| — |
|
content
|
Content of the type element. |
any
| — |
|
tag
|
Set the semantic tag for the type element. Use |
string
|
p
|
|
font_family
|
Choose the font family. Defaults to Open Sans |
string
|
opensans
|
|
size
|
Control the font-size. If size is not defined or set to auto, font-size inherits from parent container. Note that |
string
|
auto
|
|
color
|
Control the PEGA brand color. |
string
| — |
|
weight
|
Alter the weight of the text. Note that |
string
|
regular
|
|
hierarchy
|
Control the hierarch of text. Each option comes with specific typographic styles. |
string
|
body
|
|
icon_before
|
Append an icon before the text. Icon element is recommended. However, <img> elements are also acceptable. |
any
| — |
|
icon_after
|
Append an icon after the text. Icon element is recommended. However, <img> elements are also acceptable. |
any
| — |
|
npm install @bolt/elements-type
This is a type element. Use common inline HTML elements to emphasize, bold, link, and more.
{% include '@bolt-elements-type/type.twig' with {
content: 'This is a type element. Use common inline HTML elements to <em>emphasize</em>, <strong>bold</strong>, <a href="#!">link</a>, and more.'
} only %}
<p>If no props are set, the above is exactly the same as a <p> HTML element.</p>
<p class="e-bolt-type">This is a type element. Use common inline HTML elements to <em>emphasize</em>, <strong>bold</strong>, <a href="#!">link</a>, and more.</p>
<p>If no props are set, the above is exactly the same as a <p> HTML element.</p>
{% include '@bolt-elements-type/type.twig' with {
content: 'This type element is a level 4 heading. No styles are defined so this looks like plain text.'
tag: 'h4',
} only %}
<h4 class="e-bolt-type">This type element is a level 4 heading. No styles are defined so this looks like plain text.</h4>
This is size auto.
This is size tiny.
This is size xsmall.
This is size small.
This is size regular.
This is size medium.
This is size large.
This is size xlarge.
This is size xxlarge.
This is size xxxlarge.
This is size display.
This is size largedisplay.
{% include '@bolt-elements-type/type.twig' with {
content: 'This is size xxxlarge.'
size: 'xxxlarge',
} only %}
<p class="e-bolt-type e-bolt-type--size-xxxlarge">This is size xxxlarge.</p>
This font-weight is extrabold.
This font-weight is bold.
This font-weight is semibold.
This font-weight is medium.
This font-weight is regular.
This font-weight is light.
{% include '@bolt-elements-type/type.twig' with {
content: 'This is font-weight extrabold.'
weight: 'extrabold',
} only %}
<p class="e-bolt-type e-bolt-type--weight-extrabold">This font-weight is extrabold.</p>
This color is navy.
This color is teal.
This color is orange.
This color is yellow.
This color is wine.
This color is pink.
This color is berry.
This color is gray.
This color is black.
This color is white.
This color is navy.
This color is teal.
This color is orange.
This color is yellow.
This color is wine.
This color is pink.
This color is berry.
This color is gray.
This color is black.
This color is white.
{% include '@bolt-elements-type/type.twig' with {
content: 'This is teal color.'
color: 'teal',
} only %}
<p class="e-bolt-type e-bolt-type--color-teal">This color is teal.</p>
Eyebrow
Body text (basic type element).
This is size auto headline
This is size tiny headline
This is size xsmall headline
This is size small headline
This is size regular headline
This is size medium headline
This is size large headline
This is size xlarge headline
This is size xxlarge headline
This is size xxxlarge headline
This is size display headline
This is size largedisplay headline
This is size xlargedisplay headline
This is size auto subheadline
This is size tiny subheadline
This is size xsmall subheadline
This is size small subheadline
This is size regular subheadline
This is size medium subheadline
This is size large subheadline
This is size xlarge subheadline
This is size xxlarge subheadline
This is size xxxlarge subheadline
This is size display subheadline
This is size largedisplay subheadline
This is size xlargedisplay subheadline
This is an eyebrow
This is size auto body text
This is size tiny body text
This is size xsmall body text
This is size small body text
This is size regular body text
This is size medium body text
This is size large body text
This is size xlarge body text
This is size xxlarge body text
This is size xxxlarge body text
This is size display body text
This is size largedisplay body text
This is size xlargedisplay body text
{# Teaser Text Group #}
{% include '@bolt-elements-type/type.twig' with {
content: 'Eyebrow',
hierarchy: 'eyebrow',
attributes: {
'aria-label': 'Eyebrow',
},
} only %}
{% include '@bolt-elements-type/type.twig' with {
content: 'Headline (size xxxlarge and h1)',
hierarchy: 'headline',
tag: 'h1',
size: 'xxxlarge',
} only %}
{% include '@bolt-elements-type/type.twig' with {
content: 'Subheadline (size xlarge and h2)',
hierarchy: 'subheadline',
tag: 'h2',
size: 'xlarge',
} only %}
{% include '@bolt-elements-type/type.twig' with {
content: 'Paragraph (basic type element).',
} only %}
{# Mixed-weight Headlines #}
{% include '@bolt-elements-type/type.twig' with {
content: 'This entire sentence is a subheadline <strong>but part of it is bold</strong>',
hierarchy: 'subheadline',
tag: 'h1',
size: 'xxxlarge',
} only %}
<!-- Teaser Text Group -->
<p class="e-bolt-type e-bolt-type--eyebrow" aria-label="Eyebrow">
Eyebrow
</p>
<h1 class="e-bolt-type e-bolt-type--headline e-bolt-type--size-xxxlarge">
Headline (size xxxlarge and h1)
</h1>
<h2 class="e-bolt-type e-bolt-type--subheadline e-bolt-type--xlarge">
Subheadline (size xlarge and h2)
</h2>
<p class="e-bolt-type">
Paragraph (basic type element).
</p>
<!-- Mixed-weight Headlines -->
<h1 class="e-bolt-type e-bolt-type--subheadline e-bolt-type--size-xxxlarge">
This entire sentence is a subheadline <strong>but part of it is bold</strong>
</h1>
<img>
element is also acceptable.
Eyebrow with an icon before
This is a paragraph of text. In the middle of it, it has inline text with icons. This inline text is a type element with its tag set to span
.
{% set icon_pega_thumbs_up %}
{% include '@bolt-elements-icon/icon.twig' with {
name: 'pega-thumbs-up',
size: 'large',
} only %}
{% endset %}
{% set icon_pega_timer %}
{% include '@bolt-elements-icon/icon.twig' with {
name: 'pega-timer',
} only %}
{% endset %}
{% set icon_arrow_left %}
{% include '@bolt-elements-icon/icon.twig' with {
name: 'arrow-left',
} only %}
{% endset %}
{# Block Text #}
{% include '@bolt-elements-type/type.twig' with {
content: 'Eyebrow with an icon before',
icon_before: icon_arrow_left,
hierarchy: 'eyebrow',
} only %}
{% include '@bolt-elements-type/type.twig' with {
content: 'Headline with an icon after',
icon_after: icon_pega_thumbs_up,
hierarchy: 'headline',
tag: 'h1',
size: 'xxxlarge',
} only %}
{% include '@bolt-elements-type/type.twig' with {
content: 'Subheadline with an icon before and after',
icon_before: icon_pega_timer,
icon_after: icon_pega_thumbs_up,
hierarchy: 'subheadline',
tag: 'h2',
size: 'xlarge',
} only %}
{# Inline Text #}
{% set inline_text %}
{% include '@bolt-elements-type/type.twig' with {
content: 'inline text with icons',
icon_before: icon_pega_timer,
icon_after: icon_pega_thumbs_up,
tag: 'span',
} only %}
{% endset %}
{% set spaceless_inline_text %}{% apply spaceless %}{{ inline_text }}{% endapply %}{% endset %}
{% include '@bolt-elements-type/type.twig' with {
content: 'This is a paragraph of text. In the middle of it, it has ' ~ spaceless_inline_text ~ '. This inline text is a type element with its tag set to <code>span</code>.',
} only %}
<!-- Block Text -->
<h1 class="e-bolt-type e-bolt-type--headline e-bolt-type--size-xxxlarge"><span class="e-bolt-type__icon-before"><!-- Icon or image markup --></span>Subheadline with an icon before and after<span class="e-bolt-type__icon-after"><!-- Icon or image markup --></span></h1>
<!-- Inline Text -->
<p class="e-bolt-type">This is a paragraph of text. In the middle of it, it has <span class="e-bolt-type"><span class="e-bolt-type__icon-before"><!-- Icon or image markup --></span>inline text with icons<span class="e-bolt-type__icon-after"><!-- Icon or image markup --></span></span>. This inline text is a type element with its tag set to <code>span</code>.</p>
This is a paragraph of text. In the middle of it, it has an inline link. This inline link can be a Text Link element or an HTML anchor element.
{% set icon_chevron_right %}
{% include '@bolt-elements-icon/icon.twig' with {
name: 'chevron-right',
} only %}
{% endset %}
{# Block Link #}
{% include '@bolt-elements-type/type.twig' with {
content: 'Eyebrow link',
hierarchy: 'eyebrow',
icon_after: icon_chevron_right,
link_attributes: {
href: '#!',
},
} only %}
{% include '@bolt-elements-type/type.twig' with {
content: 'Headline link',
hierarchy: 'headline',
tag: 'h1',
size: 'xxxlarge',
icon_after: icon_chevron_right,
link_attributes: {
href: '#!',
},
} only %}
{% include '@bolt-elements-type/type.twig' with {
content: 'Subheadline link',
hierarchy: 'subheadline',
tag: 'h2',
size: 'xlarge',
icon_after: icon_chevron_right,
link_attributes: {
href: '#!',
},
} only %}
{# Inline Link #}
{% include '@bolt-elements-type/type.twig' with {
content: 'This is a paragraph of text. In the middle of it, it has <a href="#!">an inline link</a>. This inline link can be a Text Link element or an HTML anchor element.',
} only %}
<!-- Block Link -->
<h1 class="e-bolt-type e-bolt-type--size-xxxlarge e-bolt-type--headline"><a href="#!" class="e-bolt-text-link e-bolt-text-link--reversed-underline">Headline link<span class="e-bolt-text-link__icon-after"><!-- Icon or image markup --></span></a></h1>
<!-- Inline Link -->
<p class="e-bolt-type">This is a paragraph of text. In the middle of it, it has <a href="#!" class="e-bolt-text-link">an inline link</a>. This inline link can be a Text Link element or an HTML anchor element.</p>
{% set number %}
{% include '@bolt-elements-shape/shape.twig' with {
content: '<strong>1</strong>',
size: 'small',
attributes: {
class: 't-bolt-teal',
},
} only %}
{% endset %}
{% set headline %}
{% include '@bolt-elements-type/type.twig' with {
content: 'Numbered headline xxlarge',
hierarchy: 'headline',
tag: 'h4',
size: 'xxlarge',
} only %}
{% endset %}
{% include '@bolt-components-list/list.twig' with {
display: 'inline',
nowrap: true,
spacing: 'small',
items: [
number,
headline,
],
} only %}
<bolt-list display="inline" tag="div" spacing="small" nowrap>
<bolt-list-item>
<span class="e-bolt-shape"><span class="e-bolt-shape__content"><strong>1</strong></span></span>
</bolt-list-item>
<bolt-list-item>
<h1 class="e-bolt-type e-bolt-type--headline e-bolt-type--size-xxxlarge">Numbered headline</h1>
</bolt-list-item>
</bolt-list>
This is a type headline with the Open Sans.
This is a type headline with the Lora.
This Lora font is bold.
This Lora font is bold and italicized.
This Lora font is semibold.
This Lora font is semibold and italicized.
This Lora font is medium.
This Lora font is medium and italicized.
This Lora font is regular.
This Lora font is regular and italicized.
{% include '@bolt-elements-type/type.twig' with {
content: 'This is a type element with the Lora font family.',
font_family: 'lora',
} only %}
<p class="e-bolt-type e-bolt-type--lora">This is a type element with the Lora font family.</p>
This is a type headline with the Open Sans.
This is a type headline with the Chakra Petch.
This Chakra Petch font is bold.
This Chakra Petch font is bold and italicized.
This Chakra Petch font is semibold.
This Chakra Petch font is semibold and italicized.
This Chakra Petch font is medium.
This Chakra Petch font is medium and italicized.
This Chakra Petch font is regular.
This Chakra Petch font is regular and italicized.
This Chakra Petch font is light.
This Chakra Petch font is light and italicized.
{% include '@bolt-elements-type/type.twig' with {
content: 'This is a type element with the Chakra Petch font family.',
font_family: 'chakrapetch',
} only %}
<p class="e-bolt-type e-bolt-type--chakrapetch">This is a type element with the Chakra Petch font family.</p>