Typography

The Typography component is used to display text with various styles and sizes.

Usage

Basic Usage

Heading 1

Heading 2

Heading 3

This is a basic body text example using the Typography component.

This is a smaller caption or supporting text.
"use client";

import React from "react";
import Typography from "boreal-ui/next/Typography";

export default function TypographyBasicExample() {
  return (
    <div
      style={{
        display: "flex",
        flexDirection: "column",
        gap: "1rem",
      }}
    >
      <Typography variant="h1">Heading 1</Typography>
      <Typography variant="h2">Heading 2</Typography>
      <Typography variant="h3">Heading 3</Typography>

      <Typography variant="body">
        This is a basic body text example using the Typography component.
      </Typography>

      <Typography variant="caption">
        This is a smaller caption or supporting text.
      </Typography>
    </div>
  );
}

Props

Data table
TypeDescription
alignTypographyAlignHorizontal text alignment.
aria-atomicbooleanWhether assistive technologies should present the entire updated region when part of a live region changes.
aria-busybooleanIndicates whether the element is currently being updated, such as during loading.
aria-describedbystringReferences the id of another element that describes this element.
aria-hiddenbooleanWhether the element should be hidden from assistive technologies.
aria-labelstringDefines an accessible label for the element when a visible label is not sufficient.
aria-labelledbystringReferences the id of another element that labels this element.
aria-live"off" | "polite" | "assertive"Indicates that the element will be updated and describes how updates should be announced.
asElementTypeThe HTML element or custom component to render as. For example: `"p"`, `"span"`, `"h1"`, or a custom React component.
childrenReactNodeThe content to render inside the typography component.
classNamestringOptional custom CSS class name for the root element.
idstringOptional unique id for the root element.
italicbooleanWhether the text should be displayed in italic style.
noWrapbooleanWhether the text should remain on a single line without wrapping.
roleAriaRoleOptional ARIA role for the rendered element.
srOnlybooleanWhether the text should be visually hidden but still available to screen readers.
styleCSSPropertiesOptional inline styles applied to the root element.
testIdstringOptional test id used for testing the component.
themeTypographyThemeVisual theme style applied to the typography.
titlestringAdvisory text for the element, typically shown as a tooltip on hover.
truncatebooleanWhether overflowing text should be truncated, typically with an ellipsis.
underlinebooleanWhether the text should be underlined.
variantTypographyVariantPredefined typography style variant. Examples may include headings, body text, captions, or labels.
weightTypographyWeightFont weight of the text.