ComboStrap - Text component - Apply text typographic effects

Undraw My Documents

About

text is a typographic component that permits styling one or several paragraphs at once.

Syntax

<text type>
First paragraph

Second paragraph
</text>

where:

  • type can take the values:
    • lead: It makes a paragraph stand out by setting a bigger font-size and weight
    • h1 to h6: when you want to match the font styling of a heading.
    • custom class that you have created in your theme.
  • line-spacing sets the space between the lines of a paragraph.
  • color can take all color values and the specific text colors:
    • body: the color of the body
    • muted : light gray
    • black-50 : 50 black
    • white-50 : 50 white
  • or any typographic attributes (font size, font weight, …)

Example

Lead

<text lead>
Lorem ipsum dolor sit amet, consectetur adipiscing elit

Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
</text>

**versus:**

Lorem ipsum dolor sit amet, consectetur adipiscing elit,

sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

Lorem ipsum dolor sit amet, consectetur adipiscing elit

Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

versus:

Lorem ipsum dolor sit amet, consectetur adipiscing elit,

sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

Heading style

<text h1>
A text that looks like an heading level 1
</text>
  • Output:

A text that looks like an heading level 1

Line-Spacing

line-spacing is a styling attribute that lets you define the height between each line inside a paragraph.

Example:

<text line-spacing="xs" width="40rem">
**Extra-small line space**. This is a long paragraph written to show how the line-height of an element is affected. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
</text>
<text line-spacing="sm" width="40rem">
**Small line space**. This is a long paragraph written to show how the line-height of an element is affected. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
</text>
<text line-spacing="md" width="40rem">
**Medium line space**. This is a long paragraph written to show how the line-height of an element is affected. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
</text>
<text line-spacing="lg" width="40rem">
**Large line space**. This is a long paragraph written to show how the line-height of an element is affected. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
</text>
  • Output:

Extra-small line space. This is a long paragraph written to show how the line-height of an element is affected. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

Small line space. This is a long paragraph written to show how the line-height of an element is affected. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

Medium line space. This is a long paragraph written to show how the line-height of an element is affected. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

Large line space. This is a long paragraph written to show how the line-height of an element is affected. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

If you want to add space between component, you should use the spacing attribute

Text-Align

text alignment lets you define where the line of text will be located inside the paragraph. A paragraph is a block and takes by default all the available width

Example:

<text align="text-start">
This line of text is at the **start** of a paragraph (left for a left-to-right language)
</text>
<text align="text-center">
This line of text is **centered** inside the paragraph block.
</text>
<text align="text-end">
This line of text is at the **end** of a paragraph (right for a left-to-right language)
</text>
  • Output:

This line of text is at the start of a paragraph (left for a left-to-right language)

This line of text is centered inside the paragraph block.

This line of text is at the end of a paragraph (right for a left-to-right language)

Text alignment can also be screen conditional.

Color

This example shows the color values specific to the text and itext component

<box width="fit" spacing="p-3">
    <text color="body">Text with the body color.</text>
    <text color="muted">Text with the muted color.</text>
    <text color="black-50">Text with the black-50 color.</text>
    <text color="white-50" background-color="black">Text with the white-50 color.</text>
</box>

Text with the body color.

Text with the muted color.

Text with the black-50 color.

Text with the white-50 color.




Showcase yourself and your brand

Get free news, tips, and tricks
to create a remarkable experience for your readers.




Related HowTo's
Undraw Animating
How to align a text ?

This howto will show you how you can align your text. With ComboStrap, text alignment is only defined via the align attribute. There is three possible alignement: , ie left for a left-to-right...
Undraw Animating
How to align a text based on screen size ?

This howto shows you how to apply a text alignment that depends on the screen size. In the text align howto, you have learned to apply one of the tree possible text alignment. In this howto, you will...


Recommended Pages
Bootstrap Default Color
Color - How to specify a Color Value on ComboStrap Component

Color management in ComboStrap
Undraw My Documents
ComboStrap - Font Size Typographic Attribute

How to set the font-size with the font-size attribute
Undraw My Documents
ComboStrap - Line Spacing (Line height)

The line spacing attribute lets you set the space between each line in a paragraph
Undraw My Documents
ComboStrap - Text color

How to change the color of a text with the text-color attribue
Spacing Margin Padding
Backlinks

spacing is the definition of the margin and padding between block component where: margin is a transparent space outside the box (not filled with the background color) padding is the space inside...
Undraw My Documents
ComboStrap UI - Block

A block component is a component that wraps/encapsulate: content such as text, image,... other block component If the component should start at a new line or expand on multiple line and you can...
Undraw Website Builder Re Ii6e
ComboStrap UI - Box

A box is a component that permits to contain other components. This is useful to: define the elements that should collapse or create a styled box. layout componenttext component Align Background-Color...
Undraw Website Builder Re Ii6e
ComboStrap UI - Jumbotron

A jumbotron is a default Hero unit that emphase prominently its content. buttonleadtexthorizontal rule A jumbotron is a hero unit style content with a medium value by default where: the Hero...
Undraw My Documents
How to set the Boldness (Font Weight / Strong)

boldness is a typographic effect that sets the font weight. It defines the width of a character outlines relative to its height. It's also known as strongness.
Undraw Add Content Re Vgqa
Typographic effect and attributes in ComboStrap

How to add typographic effect to your text



Task Runner