Typography
The Pablo Typography components help you to keep a consistent look and not overload your design with
different typographical settings that can get out of date quite and unmaintainable quite quickly.
Import
// Tree shakable import
import { Typography } from '@bojagi/pablo';
// Separate components
import {
Headline,
Title,
Subtitle,
Paragraph,
InfoText,
InfoTextBold
} from '@bojagi/pablo'
// Or direct import
import { Typography ,Headline, Title /* ... */ } from '@bojagi/pablo/Typography';
Usage
Pablo has the following Typography variants:
headlinefor the main heading of a pagetitlefor section headingssubtitlefor sub section headingsparagraphfor floating textparagraphBoldfor inline parts within paragraphs that should have an emphasisinfofor information texts (small type size)infoBoldfor information texts (small type size)
You can pass the variant as a prop in the Typography component.
import { Typography } from '@bojagi/pablo/Typography';
<Typography variant="headline">Pablo documenatation</Typography>
To make your code more readable there are separate components available for you to use.
Live Editor
<> <Headline>Headline</Headline> <Title>Title</Title> <Subtitle>Subtitle</Subtitle> <Paragraph>Paragraph</Paragraph> <Paragraph bold>Paragraph Bold</Paragraph> <InfoText>Info</InfoText> <InfoText bold>Info Bold</InfoText> </>
Result
Loading...
Examples
Inline text
To put text somewhere without any padding or margin, you can set the boolean inline prop.
Live Editor
<> <Headline inline>Headline</Headline> <Title inline>Title</Title> <Subtitle inline>Subtitle</Subtitle> <Paragraph inline>Paragraph</Paragraph> <Paragraph inline bold>Paragraph Bold</Paragraph> <InfoText inline>Info</InfoText> <InfoText inline bold>Info Bold</InfoText> </>
Result
Loading...
Colored text
To use color with a text just pass the textColor prop and pass the color name.
For example you can use the info text color, that by default is a bit lighter than the standard text color.
Live Editor
<InfoText textColor="text.info">This is some info</InfoText>
Result
Loading...
You can use also brand, positive or negative colors:
Live Editor
<> <Headline textColor="brand.main">Headline</Headline> <Title textColor="positive.main">Title</Title> <Subtitle textColor="negative.main">Subtitle</Subtitle> <Paragraph textColor="positive.dark">Paragraph</Paragraph> <Paragraph bold textColor="positive.light">Paragraph Bold</Paragraph> <InfoText textColor="brand.light">Info Text</InfoText> <InfoText bold textColor="brand.dark">Info Text Bold</InfoText> <Paragraph textColor="neutral.dark">Paragraph</Paragraph> </>
Result
Loading...
Props
| Name | Type | Default Value | Required | Description |
|---|
Box props
| Name | Type | Default Value | Required | Description |
|---|