The Typography component can be used to render most html text elements.
import Typography from 'react-toolbox/lib/typography';
const TypographyTest = () => (
<div>
<Typography tag="h1">Heading Level 1</Typography>
<Typography tag="p">
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean
commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus
et magnis dis parturient montes, nascetur ridiculus mus. Donec quam
felis, ultricies nec, pellentesque eu, pretium quis, sem
</Typography>
<Typography tag="span">This is a normal span.</Typography>
</div>
);
If you want to provide a theme via context, the component key is RTTypography
.
You can add as many properties as you want to be directly transferred to the output typography element. Apart from them you have the following properties:
Name | Type | Default | Description |
---|---|---|---|
align |
String |
'' |
One of either left , right , center , or an empty string. |
className |
String |
'' |
Sets a custom class name to add styles to the link. |
semibold |
Boolean |
false |
Sets the font weight to semibold. |
headingSize |
String |
'' |
One of 'h1', 'h2', 'h3', 'h4', 'h5' or an empty string. Can be used to override the default heading size. |
italic |
Boolean |
false |
Sets the font style to italic. |
noMargin |
Boolean |
false |
Can be used on block level elements remove the bottom margin. |
tag |
String |
p |
One of 'h1','h2','h3','h4','h5','p','span','small','em','strong' . Sets the rendered html tag of the component. |
small |
Boolean |
false |
Sets the font size to theme's tiny font size. |
Name | Description |
---|---|
bodyText |
Sets the base styles of all non-heading text elements. |
paragraph |
Sets the styles of paragraphs. |
heading |
Sets the base styles for all headings. |