Skip to content

Typography

Text style utilities that set font size, weight and line height together.

Dify UI ships its type scale as Tailwind CSS utilities. Each utility sets font size, font weight and line height together, and a few also set uppercase text. Use one utility per text element instead of combining text-*, font-* and leading-* classes.

Names follow <role>-<size>-<weight>. Color is separate: pair a type utility with a text color token such as text-text-secondary.

System

System styles are for interface text: labels, menu items, buttons and metadata.

UtilitySizeWeightLine heightSample
system-2xs-regular-uppercase10px40012pxThe quick brown fox
system-2xs-regular10px40012pxThe quick brown fox
system-2xs-medium10px50012pxThe quick brown fox
system-2xs-medium-uppercase10px50012pxThe quick brown fox
system-2xs-semibold-uppercase10px60012pxThe quick brown fox
system-xs-regular12px40016pxThe quick brown fox
system-xs-regular-uppercase12px40016pxThe quick brown fox
system-xs-medium12px50016pxThe quick brown fox
system-xs-medium-uppercase12px50016pxThe quick brown fox
system-xs-semibold12px60016pxThe quick brown fox
system-xs-semibold-uppercase12px60016pxThe quick brown fox
system-sm-regular13px40016pxThe quick brown fox
system-sm-medium13px50016pxThe quick brown fox
system-sm-medium-uppercase13px50016pxThe quick brown fox
system-sm-semibold13px60016pxThe quick brown fox
system-sm-semibold-uppercase13px60016pxThe quick brown fox
system-md-regular14px40020pxThe quick brown fox
system-md-medium14px50020pxThe quick brown fox
system-md-semibold14px60020pxThe quick brown fox
system-md-semibold-uppercase14px60020pxThe quick brown fox
system-xl-medium16px50024pxThe quick brown fox
system-xl-semibold16px60024pxThe quick brown fox

Body

Body styles are for running text and descriptions.

UtilitySizeWeightLine heightSample
body-xs-regular12px40016pxThe quick brown fox
body-xs-medium12px50016pxThe quick brown fox
body-sm-regular13px40016pxThe quick brown fox
body-sm-medium13px50016pxThe quick brown fox
body-md-regular14px40020pxThe quick brown fox
body-md-medium14px50020pxThe quick brown fox
body-lg-regular15px40020pxThe quick brown fox
body-2xl-regular18px4001.5The quick brown fox

Title

Title styles are for headings in panels, dialogs and pages.

UtilitySizeWeightLine heightSample
title-xs-semi-bold12px60016pxThe quick brown fox
title-sm-semi-bold13px60016pxThe quick brown fox
title-md-semi-bold14px60020pxThe quick brown fox
title-lg-bold15px7001.2The quick brown fox
title-xl-semi-bold16px6001.2The quick brown fox
title-2xl-semi-bold18px6001.2The quick brown fox
title-3xl-semi-bold20px6001.2The quick brown fox
title-3xl-bold20px7001.2The quick brown fox
title-4xl-semi-bold24px6001.2The quick brown fox
title-5xl-semi-bold30px6001.2The quick brown fox
title-5xl-bold30px7001.2The quick brown fox

Code

UtilitySizeWeightLine heightSample
code-xs-regular12px4001.5The quick brown fox
code-sm-regular13px4001.5The quick brown fox
code-sm-semibold13px6001.5The quick brown fox

Keyboard

system-kbd sets the text inside a keyboard shortcut. See Kbd.

UtilitySizeWeightLine heightSample
system-kbd12px50016pxThe quick brown fox

Extra theme keys

Dify UI also adds these keys to the Tailwind CSS theme, so classes such as text-2xs work alongside the default scale.

Theme keyValue
--text-2xs0.625rem

The docs-* text styles on this site belong to the documentation site, not to Dify UI.