<bolt-text>
This is text.
</bolt-text>
Prop Name | Description | Type | Default Value | Option(s) |
---|---|---|---|---|
attributes
|
A Drupal-style attributes object with extra attributes to append to this component. |
object
| — |
|
text
*
|
Text content of the headline. |
string
| — |
|
tag
|
HTML semantic tags. |
string
|
p
|
|
display
|
Inline text or a block of text. |
string
|
block
|
|
color
|
Text color in context of theme colors. |
string
|
theme-body
|
|
align
|
Text alignment. |
string
|
inherit
|
|
opacity
|
Opacity level. |
number
|
100
|
|
quoted
|
Quoted text. |
boolean
|
false
|
|
line-height
|
Line height in context of the typographic design. |
string
|
regular
|
|
letter-spacing
|
Letter spacing in context of the typographic design. |
string
|
regular
|
|
text-transform
|
Transform controls the type case. Please note that capitalize would capitalize the first letter of each word, it is not the same as title case. |
string
|
regular
|
|
font-family
|
Font family in context of the typographic design. |
string
|
body
|
|
font-size
|
Font size in context of the typographic design. |
string
|
medium
|
|
font-weight
|
Font weight in context of the typographic design. |
string
|
regular
|
|
font-style
|
Emphasized text. |
string
|
regular
|
|
headline
|
A preset for headlines in context of the typographic design. |
boolean
|
false
|
|
subheadline
|
A preset for subheadlines in context of the typographic design. |
boolean
|
false
|
|
eyebrow
|
A preset for eyebrow in context of the typographic design. |
boolean
|
false
|
|
util
|
Each item in the array will build a utility class. No need to include |
array
| — |
|
npm install @bolt/components-text
<bolt-text>
in the markup to make it render.
<bolt-text>
This is text.
</bolt-text>
<bolt-text>
allows for separation of semantics and visual. Using a semantically correct tag will not affect the appearance of the text.
<bolt-text tag="h1">
This text has its tag prop defined as: h1
</bolt-text>
<bolt-text tag="h2">
This text has its tag prop defined as: h2
</bolt-text>
<bolt-text tag="h3">
This text has its tag prop defined as: h3
</bolt-text>
<bolt-text tag="h4">
This text has its tag prop defined as: h4
</bolt-text>
<bolt-text tag="h5">
This text has its tag prop defined as: h5
</bolt-text>
<bolt-text tag="h6">
This text has its tag prop defined as: h6
</bolt-text>
<bolt-text tag="p">
This text has its tag prop defined as: p
</bolt-text>
<bolt-text tag="div">
This text has its tag prop defined as: div
</bolt-text>
<bolt-text tag="span">
This text has its tag prop defined as: span
</bolt-text>
<bolt-text>
can be defined as a paragraph of text (block display) or a piece of inline text (inline display).
<bolt-text display="block">
This paragraph of text has block display, which means it will take up the full width of its container.
</bolt-text>
<bolt-text display="block">
This paragraph of text also has block display, but within this paragraph, certain text can be <bolt-text display="inline" font-weight="bold" text-transform="uppercase">inline display</bolt-text>, and it can be styled differently than the rest of the paragraph.
</bolt-text>
<bolt-text>
can be colored accordingly based on theming. It can either take on a particular theme's headline color or body text color.
<bolt-text color="theme-headline" font-weight="bold" font-size="large">
This text has its color prop defined as: theme-headline
</bolt-text>
<bolt-text color="theme-body" font-weight="bold" font-size="large">
This text has its color prop defined as: theme-body
</bolt-text>
<bolt-text>
can be aligned horizontally. This only applies if display is set to block.
<bolt-text display="block" align="inherit">
This text has its align prop defined as: inherit
</bolt-text>
<bolt-text display="block" align="start">
This text has its align prop defined as: start
</bolt-text>
<bolt-text display="block" align="center">
This text has its align prop defined as: center
</bolt-text>
<bolt-text display="block" align="end">
This text has its align prop defined as: end
</bolt-text>
<bolt-text>
can be adjusted in terms of opacity. The options are synced with Bolt's opacity scale.
<bolt-text opacity="100">
This text has its opacity prop defined as: 100
</bolt-text>
<bolt-text opacity="80">
This text has its opacity prop defined as: 80
</bolt-text>
<bolt-text opacity="60">
This text has its opacity prop defined as: 60
</bolt-text>
<bolt-text opacity="40">
This text has its opacity prop defined as: 40
</bolt-text>
<bolt-text opacity="20">
This text has its opacity prop defined as: 20
</bolt-text>
<bolt-text>
can be turned into a quote by using the quoted
boolean prop.
<bolt-text quoted>
This text is quoted.
</bolt-text>
<bolt-text headline quoted>
This headline text is also quoted.
</bolt-text>
<bolt-text>
has a few options for leading (line-height). Leading can be adjusted for legibility. The default is regular.
<bolt-text line-height="tight">
This text has<br>
its line-height<br>
prop defined as:<br>
tight
</bolt-text>
<bolt-text line-height="regular">
This text has<br>
its line-height<br>
prop defined as:<br>
regular
</bolt-text>
<bolt-text line-height="loose">
This text has<br>
its line-height<br>
prop defined as:<br>
loose
</bolt-text>
<bolt-text>
has a few options for the spacing in between letters. It can be adjusted for legibility. The default is regular.
<bolt-text letter-spacing="narrow">
This text has its letter-spacing prop defined as: narrow
</bolt-text>
<bolt-text letter-spacing="regular">
This text has its letter-spacing prop defined as: regular
</bolt-text>
<bolt-text letter-spacing="wide">
This text has its letter-spacing prop defined as: wide
</bolt-text>
<bolt-text>
has a few options for transforming letter case. It can be adjusted for legibility. The default is regular.
<bolt-text text-transform="regular">
This text has its text-transform prop defined as: regular
</bolt-text>
<bolt-text text-transform="uppercase">
This text has its text-transform prop defined as: uppercase
</bolt-text>
<bolt-text text-transform="lowercase">
This text has its text-transform prop defined as: lowercase
</bolt-text>
<bolt-text text-transform="capitalize">
This text has its text-transform prop defined as: capitalize
</bolt-text>
<bolt-text>
has a few options to change typefaces. These options are relative to the types of text such as heading, body, and code. Each type is linked to a specific typeface. This method accounts for our evolving brand.
<bolt-text font-family="headline">
This text has its font-family prop defined as: headline
</bolt-text>
<bolt-text font-family="body">
This text has its font-family prop defined as: body
</bolt-text>
<bolt-text font-family="code">
This text has its font-family prop defined as: code
</bolt-text>
<bolt-text>
has font-size options to indicate information hierarchy.
<bolt-text font-size="xsmall">
This text has its font-size prop defined as: xsmall
</bolt-text>
<bolt-text font-size="small">
This text has its font-size prop defined as: small
</bolt-text>
<bolt-text font-size="medium">
This text has its font-size prop defined as: medium
</bolt-text>
<bolt-text font-size="large">
This text has its font-size prop defined as: large
</bolt-text>
<bolt-text font-size="xlarge">
This text has its font-size prop defined as: xlarge
</bolt-text>
<bolt-text font-size="xxlarge">
This text has its font-size prop defined as: xxlarge
</bolt-text>
<bolt-text font-size="xxxlarge">
This text has its font-size prop defined as: xxxlarge
</bolt-text>
<bolt-text>
has font-style options to indicate simple emphasis.
<bolt-text font-style="regular">
This text has its font-style prop defined as: regular
</bolt-text>
<bolt-text font-style="italic">
This text has its font-style prop defined as: italic
</bolt-text>
<bolt-text>
has font-weight options to indicate emphasis hierarchy.
<bolt-text font-weight="regular">
This text has its font-weight prop defined as: regular
</bolt-text>
<bolt-text font-weight="semibold">
This text has its font-weight prop defined as: semibold
</bolt-text>
<bolt-text font-weight="bold">
This text has its font-weight prop defined as: bold
</bolt-text>
<bolt-text>
component, among many other web components in Bolt, will support server-side rendering via the new upcoming {% filter bolt_ssr %}
custom Twig filter. Check out the docs on server-side rendering for information!
{% filter bolt_ssr %}
<bolt-text>
This is text.
</bolt-text>
{% endfilter %}