Skip to content

Typography Components

[04] Typography Components

Title

React Title component for Tailwind CSS v4: an h3 heading for cards, dialogs and subsections, one level below SectionTitle, with size, color and weight props.

SourceEdit this page

Title is the third level of the heading set, used for card headings, dialog titles and subsection headings. A Modal given a plain-text title renders it as a Title. Passing href swaps the <h3> for an <a> and drops the heading semantics, so to link a heading, nest a Link inside it instead. The levels above are SectionTitle (<h2>) and PageTitle (<h1>).

Basic usage

Title renders an <h3> heading for subsection headings. It defaults to fontSemibold weight, fontHeading font family, and left-aligned text.

Subsection Heading
<Title>Subsection Heading</Title>

Sizes

Titles come in five sizes: xs, sm, md (default), lg, xl. On the page they run 18, 20, 24, 30 and 36px and scale down on tablets and phones. Inside a Card or a Modal a Title runs 14, 16, 18, 20 and 24px at every width (see type sizes inside a Card).

Extra Small Title
Small Title
Medium Title (default)
Large Title
Extra Large Title
<Col>
<Title xs>Extra Small Title</Title>
<Title sm>Small Title</Title>
<Title>Medium Title (default)</Title>
<Title lg>Large Title</Title>
<Title xl>Extra Large Title</Title>
</Col>

Appearances

By default, Title uses the inheritAppearance appearance: it inherits color from its parent. Use explicit appearances like primary, secondary, success, danger, warning, info to override.

Primary Title
Secondary Title
Success Title
Warning Title
Danger Title
Info Title
<Col>
<Title primary>Primary Title</Title>
<Title secondary>Secondary Title</Title>
<Title success>Success Title</Title>
<Title warning>Warning Title</Title>
<Title danger>Danger Title</Title>
<Title info>Info Title</Title>
</Col>

Variants

Headings never paint a background, so the variant only picks which colour of the appearance the heading is painted in. outline, the default, uses the appearance's own colour. filled uses the "on this fill" colour, for a heading sitting on a filled surface of the same appearance.

outline info, on the page surface
outline danger, on the page surface
filled info, on a matching filled Card
filled danger, on a matching filled Card
<Col>
<Title info>outline info, on the page surface</Title>
<Title danger>outline danger, on the page surface</Title>
<Card info filled>
<Title info filled>filled info, on a matching filled Card</Title>
</Card>
<Card danger filled>
<Title danger filled>filled danger, on a matching filled Card</Title>
</Card>
</Col>

Title vs PageTitle vs SectionTitle

Three heading components for a clean semantic hierarchy. Use them together so the document outline matches the visual hierarchy.

Page Heading (h1)
Section Heading (h2)
Subsection Heading (h3)
<Col>
<PageTitle>Page Heading (h1)</PageTitle>
<SectionTitle>Section Heading (h2)</SectionTitle>
<Title>Subsection Heading (h3)</Title>
</Col>

Font weights

Title is fontSemibold by default. Override with any weight prop: fontThin, fontExtralight, fontLight, fontNormal, fontMedium, fontSemibold, fontBold, fontExtrabold, fontBlack.

Light Title
Normal Title
Medium Title
Semibold Title (default)
Bold Title
Black Title
<Col>
<Title fontLight>Light Title</Title>
<Title fontNormal>Normal Title</Title>
<Title fontMedium>Medium Title</Title>
<Title>Semibold Title (default)</Title>
<Title fontBold>Bold Title</Title>
<Title fontBlack>Black Title</Title>
</Col>

Font families

Switch between fontSans, fontSerif, and fontMono font families.

Sans-serif Title
Serif Title
Monospace Title
<Col>
<Title fontSans>Sans-serif Title</Title>
<Title fontSerif>Serif Title</Title>
<Title fontMono>Monospace Title</Title>
</Col>

Italic

Use the italic prop for italic emphasis.

Italic Title
<Title italic>Italic Title</Title>

Uppercase

Use the uppercase prop to render the title in all caps.

Uppercase Title
<Title uppercase>Uppercase Title</Title>

Text alignment

Title is left-aligned by default. Use textCenter, textRight, or textJustify to change alignment.

Left Aligned (default)
Center Aligned
Right Aligned
<Card>
<Title wFull>Left Aligned (default)</Title>
<Title wFull textCenter>Center Aligned</Title>
<Title wFull textRight>Right Aligned</Title>
</Card>

Custom HTML tag

Override the rendered tag with the tag prop when the visual style of Title is wanted but a different semantic level is required.

Rendered as h1

Rendered as h2

Rendered as h3 (default)

Rendered as h4

<Col>
<Title tag="h1">Rendered as h1</Title>
<Title tag="h2">Rendered as h2</Title>
<Title>Rendered as h3 (default)</Title>
<Title tag="h4">Rendered as h4</Title>
</Col>

Title with Badge context

Titles pair naturally with badges, chips, and other inline components.

Release Notes
New
Deprecated API
Removed
<Col>
<Row>
<Title>Release Notes</Title>
<Badge success>New</Badge>
</Row>
<Row>
<Title>Deprecated API</Title>
<Badge danger>Removed</Badge>
</Row>
</Col>

Title in context

Titles work well with other typography components in cards and sections.

Product Features

Everything you need to build modern applications.

Performance

Optimized for speed and efficiency.

Accessibility

Built with ARIA best practices.

<Card>
<Title lg primary fontBold>Product Features</Title>
<Text secondary>Everything you need to build modern applications.</Text>
<Title sm>Performance</Title>
<Text>Optimized for speed and efficiency.</Text>
<Title sm>Accessibility</Title>
<Text>Built with ARIA best practices.</Text>
</Card>

Frequently asked questions

How do I change the font of every heading?

Re-declare the --font-heading token, which Title, SectionTitle and PageTitle read through their default fontHeading prop. It points at the sans font, so headings match the body text until you set it, for example with :root { --font-heading: Georgia, serif; } after the VaneUI stylesheet. A web font has to be loaded before the token can name it.

Why does my page outline jump from h1 to h3?

Title renders an <h3>, so a page with a PageTitle and Titles but no SectionTitle skips the second level, which screen reader users notice when they move from heading to heading. Use a SectionTitle for the <h2> level, or keep the look of a Title and pass tag="h2", as under Custom HTML tag. Each heading should be one level below the heading of its section.

How do I change every Title at once?

Set the defaults on the flat title node, for example themeDefaults={{ title: { fontBold: true } }}. A Modal renders its plain-text title as a Title, so dialog titles follow the same node. SectionTitle and PageTitle have their own nodes, sectionTitle and pageTitle, so a change to title leaves them as they are.

Title Props

PropCategoryDefaultDescription
accent

Appearance

Accent color appearance (rose)

danger

Appearance

Danger color appearance (red)

info

Appearance

Info color appearance (cyan)

inheritAppearance

Appearance

✓

Inherit appearance from parent — suppresses own data-appearance/data-variant, uses parent's CSS variables

primary

Appearance

Primary color appearance (gray)

secondary

Appearance

Secondary color appearance (gray)

success

Appearance

Success color appearance (green)

tertiary

Appearance

Tertiary color appearance

warning

Appearance

Warning color appearance (amber)

fontHeading

Font Family

✓

Heading font family (defaults to sans, customizable via --font-heading) — emits font-heading

fontMono

Font Family

Monospace font family — emits font-mono

fontSans

Font Family

Sans-serif font family (default) — emits font-sans

fontSerif

Font Family

Serif font family — emits font-serif

italic

Font Style

Italic font style

notItalic

Font Style

Not italic (normal) font style

fontBlack

Font Weight

Black font weight (900) — emits font-black

fontBold

Font Weight

Bold font weight (700) — emits font-bold

fontExtrabold

Font Weight

Extra bold font weight (800) — emits font-extrabold

fontExtralight

Font Weight

Extra light font weight (200) — emits font-extralight

fontLight

Font Weight

Light font weight (300) — emits font-light

fontMedium

Font Weight

Medium font weight (500) — emits font-medium

fontNormal

Font Weight

Normal font weight (400) — emits font-normal

fontSemibold

Font Weight

✓

Semibold font weight (600) — emits font-semibold

fontThin

Font Weight

Thin font weight (100) — emits font-thin

inheritColor

Inherit Color

Inherit text color from parent via CSS variable cascade (suppresses data-appearance emission)

noInheritColor

Inherit Color

Keep own text color; do not inherit from parent

inheritSize

Inherit Size

Inherit font-size and line-height from the nearest parent typography element

noInheritSize

Inherit Size

Keep own font-size; do not inherit from parent

trackingNormal

Letter Spacing

Normal letter spacing (0)

trackingTight

Letter Spacing

Tight letter spacing (-0.025em)

trackingTighter

Letter Spacing

Tighter letter spacing (-0.05em)

trackingWide

Letter Spacing

Wide letter spacing (0.025em)

trackingWider

Letter Spacing

Wider letter spacing (0.05em)

trackingWidest

Letter Spacing

Widest letter spacing (0.1em)

margin

Margin

Enable margin on all sides

marginB

Margin

Enable only bottom margin

marginT

Margin

Enable only top margin

marginX

Margin

Enable only horizontal (inline) margin

marginY

Margin

Enable only vertical (block) margin

noMargin

Margin

Disable margin (reset to 0)

lg

Size

Large size

md

Size

✓

Medium size (default)

sm

Size

Small size

xl

Size

Extra large size

xs

Size

Extra small size

skeleton

Skeleton

Show the component as a loading placeholder in its own size and shape. On a container, every component inside it becomes a placeholder too

srOnly

Sr Only

Hide visually and keep it for screen readers (sr-only)

textCenter

Text Align

Align text to center

textEnd

Text Align

Align text to the reading-direction end (right in LTR, left in RTL)

textJustify

Text Align

Justify text

textLeft

Text Align

✓

Align text to left (physical side, does not flip under RTL)

textRight

Text Align

Align text to right (physical side, does not flip under RTL)

textStart

Text Align

Align text to the reading-direction start (left in LTR, right in RTL)

lineThrough

Text Decoration

Add strikethrough/line-through decoration across text

noUnderline

Text Decoration

Remove ALL text-decoration — underline, line-through, and overline (text-decoration: none)

overline

Text Decoration

Add overline decoration above text

underline

Text Decoration

Add underline decoration below text

capitalize

Text Transform

Capitalize first letter of each word

lowercase

Text Transform

Transform text to lowercase

normalCase

Text Transform

Normal text case (no transformation)

uppercase

Text Transform

Transform text to uppercase

lineClamp2

Truncate

Truncate at 2 lines with ellipsis

lineClamp3

Truncate

Truncate at 3 lines with ellipsis

lineClamp4

Truncate

Truncate at 4 lines with ellipsis

lineClamp5

Truncate

Truncate at 5 lines with ellipsis

noTruncate

Truncate

Remove truncation

truncate

Truncate

Single line truncation with ellipsis

filled

Variant

Filled variant - solid background with contrasting text color

ghost

Variant

Ghost variant - transparent background, no border, appearance-colored text, tinted hover background

outline

Variant

✓

Outline variant - transparent background with border and colored text (default)

breakAll

Word Break

Break between any two characters - word-break: break-all

breakKeep

Word Break

Do not break CJK text - word-break: keep-all

breakNormal

Word Break

Reset breaking - overflow-wrap and word-break normal

breakWords

Word Break

Break long words to prevent overflow - overflow-wrap: break-word

Layout & utility props (gap, padding, hide, items, justify, ...)

Documented on Common Props.

PropCategoryDefaultDescription
cursorDefault

Cursor

Default cursor - standard arrow

cursorMove

Cursor

Move cursor - indicates draggable element

cursorNone

Cursor

No cursor - hides the cursor

cursorNotAllowed

Cursor

Not-allowed cursor - indicates disabled state

cursorPointer

Cursor

Pointer cursor - indicates clickable element

cursorText

Cursor

Text cursor - indicates selectable text

cursorWait

Cursor

Wait cursor - indicates loading/processing

block

Display

Block display - takes full width, new line

contents

Display

Contents display - element's box is removed, children display as if parent didn't exist

flex

Display

Flex display - flexbox container

grid

Display

Grid display - CSS grid container

hidden

Display

Hidden display - element is not visible

inline

Display

Inline display - flows with text

inlineBlock

Display

Inline-block display - inline but with block properties

inlineFlex

Display

Inline-flex display - inline flexbox container

inlineGrid

Display

Inline-grid display - inline grid container

table

Display

Table display - behaves like table element

tableCell

Display

Table-cell display - behaves like td element

hAuto

Height

Set height to auto

hFit

Height

Set height to fit-content

hFull

Height

Set height to 100%

hScreen

Height

Set height to 100vh (viewport height), removes max-height constraint

desktopHide

Hide

Hide element on desktop devices and below (max-desktop: 80rem)

mobileHide

Hide

Hide element on mobile devices and below (max-mobile: 48rem)

tabletHide

Hide

Hide element on tablet devices and below (max-tablet: 64rem)

itemsBaseline

Items

Align items to baseline

itemsCenter

Items

Align items to center

itemsEnd

Items

Align items to end (bottom/right)

itemsStart

Items

Align items to start (top/left)

itemsStretch

Items

Stretch items to fill container

justifyAround

Justify

Distribute items with space around them

justifyBaseline

Justify

Align items along their baseline on main axis

justifyBetween

Justify

Distribute items with space between them

justifyCenter

Justify

Center items along the main axis

justifyEnd

Justify

Pack items toward the end of the main axis

justifyEvenly

Justify

Distribute items with equal space around them

justifyStart

Justify

Pack items toward the start of the main axis

justifyStretch

Justify

Stretch items to fill the main axis

overflowAuto

Overflow

Auto overflow - show scrollbars if needed

overflowClip

Overflow

Clip overflow - hard clip without scrollbars

overflowHidden

Overflow

Hidden overflow - clip content without scrollbars

overflowScroll

Overflow

Scroll overflow - always show scrollbars

overflowVisible

Overflow

Visible overflow - content extends beyond bounds

overflowXAuto

Overflow

Auto overflow on X-axis only

overflowXClip

Overflow

Clip overflow on X-axis only

overflowXHidden

Overflow

Hidden overflow on X-axis only

overflowXScroll

Overflow

Scroll overflow on X-axis only

overflowXVisible

Overflow

Visible overflow on X-axis only

overflowYAuto

Overflow

Auto overflow on Y-axis only

overflowYClip

Overflow

Clip overflow on Y-axis only

overflowYHidden

Overflow

Hidden overflow on Y-axis only

overflowYScroll

Overflow

Scroll overflow on Y-axis only

overflowYVisible

Overflow

Visible overflow on Y-axis only

absolute

Position

Absolute positioning

fixed

Position

Fixed positioning

relative

Position

Relative positioning

static

Position

Static positioning

sticky

Position

Sticky positioning at the top edge; set --sticky-top to stick below a fixed header

responsiveSizing

Responsive Sizing

✓

Enable responsive sizing - uses breakpoint-specific classes for font size, padding, and gap

desktopWFull

Responsive Width

Set width to 100% on desktop and below, below 1280px (max-desktop: 80rem)

mobileWFull

Responsive Width

Set width to 100% on mobile, below 768px (max-mobile: 48rem)

tabletWFull

Responsive Width

Set width to 100% on tablet and below, below 1024px (max-tablet: 64rem)

desktopShow

Show

Show element only on desktop and below, below 1280px (hidden from 80rem up)

mobileShow

Show

Show element only on mobile, below 768px (hidden from 48rem up)

tabletShow

Show

Show element only on tablet and below, below 1024px (hidden from 64rem up)

whitespaceBreakSpaces

Whitespace

Preserve whitespace incl. trailing spaces, wrap text (white-space: break-spaces)

whitespaceNormal

Whitespace

Normal wrapping - default browser behavior

whitespaceNowrap

Whitespace

No wrap - text stays on single line

whitespacePre

Whitespace

Preserve whitespace and line breaks

whitespacePreLine

Whitespace

Preserve line breaks, collapse spaces, wrap text

whitespacePreWrap

Whitespace

Preserve whitespace, wrap text

wAuto

Width

Set width to auto

wFit

Width

✓

Set width to fit-content

wFull

Width

Set width to 100%

wScreen

Width

Set width to 100vw (viewport width), removes max-width constraint