import "capsomer/tokens.css";
import { Title, Text } from "capsomer/react/text";
Usage
<h2 class="cap-title" data-size="2">Abstracts</h2>
<p class="cap-text" data-size="small" data-tone="muted">Submitted by the author.</p>
import { Text, Title } from "capsomer/react/text";
<Title as="h1" size={2}>Abstracts</Title>
<Text size="small" tone="muted">Submitted by the author.</Text>
API reference
Title
Prop
Type
Required
Does
size
1 | 2 | 3 | 4 | 5 | 6
The look, 1 the largest to 6; 4 when omitted. The heading level is as (h2 when omitted).
Title renders an h2 by default and size changes only the look, so set as to the level the outline needs: an h1 that looks like a 2 is <Title as="h1" size={2}>.
Every tone keeps its contrast on every surface (contrast report).