Skip to content

Typography

Typography components for text, titles, and paragraphs.

Text

Text types

Default textSecondary textSuccess textWarning textDanger textDisabled text

Decorations

StrongMarkCodeUnderlineDeleteItalic

Custom mark color (mark + CSS variable)

Default mark color
Custom mark color (--oas-text-mark-bg)

Font weight (weight)

regularmediumsemiboldbold
strong (equivalent to semibold weight)

Numeric (tabular-nums)

Default digits: 1 2 3 4 5 6 7 8 9 0tabular-nums: 1 2 3 4 5 6 7 8 9 0
Default: 12,345.67Tabular: 12,345.67Tabular: 1,234.56

Text alignment (align)

start: left-aligned (default start)center: centered (common for headings)end: right-alignedjustify: justified for paragraphs, stretching word spacing so both edges align.

Text depth

Depth 1 (secondary)Depth 2 (tertiary)Depth 3 (weakest)

Custom tag

subsupinsmarkb

Ellipsis

Text ellipsis

This is a long piece of text that will be truncated with an ellipsis once it exceeds the container width, without wrapping.

Multiline ellipsis (line-clamp)

This is a much longer piece of text. The line-clamp attribute limits it to at most two lines, truncating the rest with an ellipsis. Multiline ellipsis needs no measurement — pure CSS, ideal for card summaries and list intros.

Ellipsis with suffix (ellipsis-suffix)

To be, or not to be, that is the question: Whether 'tis nobler in the mind to suffer the slings and arrows of outrageous fortune

Copyable

Copyable text

Copyable text content

Custom copy text (copy-text)

Install command: click copy to copy `npm i @oas-ui/ui`

Actions

Actions position

Copy button after text (default)
Copy button before text
Custom action content

Title

Heading levels

Heading 1Heading 2Heading 3

Paragraph

Paragraphs

Paragraph text 1Paragraph text 2

API

ComponentTagProps
Textoas-texttype, ellipsis, copyable
Titleoas-titlelevel (1-5), type, ellipsis
Paragraphoas-paragraphtype, ellipsis

type values: default / secondary / success / warning / danger / disabled.

oas-text

AttributeDescriptionTypeDefault
actions-positionAction bar position: start (before the text) / end (default, after the text); pair with slot="actions"stringend
alignText alignment: start/center/end/justifyAlignType
codeInline code style (monospace + light background)boolean
copy-textCustom content to copy (defaults to the current text)string
copyableShow a copy button that copies the text content on clickboolean
deleteStrikethrough (<del> semantics)boolean
depthText softening tier: 1 / 2 / 3 (progressively lighter); only effective with type="default"string
ellipsisSingle-line ellipsis when the text overflows its containerboolean
ellipsis-suffixSuffix preserved when ellipsized (e.g. an expand link); works with ellipsis / line-clampstring
italicItalic (<em> semantics)
levelHeading level (1-5)string3
line-clampNumber of lines before multi-line ellipsis (positive integer); combinable with ellipsis-suffixstring
markHighlighted mark (light yellow background, <mark> semantics)
numericTabular figures (font-variant-numeric: tabular-nums) for aligned numeric columns in tables/stats
strongBold (font-weight 600, <strong> semantics)
tagRender tag: replaces the default element (e.g. sub / sup / ins / em / strong)string
typeText type: default / secondary / success / warning / danger / disabledTextTypedefault
underlineUnderline
weightFont weight: regular/medium/semibold/bold (compatible with the strong boolean)WeightType
EventDescription
oas-copyCopy succeeded, detail: { text }
oas-copy-errorCopy failed, detail: { text }
NameDescription
default
actionsAction slot (copy/edit buttons etc.); position determined by actions-position

oas-title

AttributeDescriptionTypeDefault
actions-positionAction bar position: start (before the text) / end (default, after the text); pair with slot="actions"stringend
alignAlignType
codeInline code style (monospace + light background)boolean
copy-textCustom content to copy (defaults to the current text)string
copyableShow a copy button that copies the text content on clickboolean
deleteStrikethrough (<del> semantics)boolean
depthText softening tier: 1 / 2 / 3 (progressively lighter); only effective with type="default"string
ellipsisSingle-line ellipsis when the text overflows its containerboolean
ellipsis-suffixSuffix preserved when ellipsized (e.g. an expand link); works with ellipsis / line-clampstring
italicItalic (<em> semantics)
levelHeading level (1-5)string3
line-clampNumber of lines before multi-line ellipsis (positive integer); combinable with ellipsis-suffixstring
markHighlighted mark (light yellow background, <mark> semantics)
numeric
strongBold (font-weight 600, <strong> semantics)
tagRender tag: replaces the default element (e.g. sub / sup / ins / em / strong)string
typeText type: default / secondary / success / warning / danger / disabledTextTypedefault
underlineUnderline
weightWeightType
EventDescription
oas-copyCopy succeeded, detail: { text }
oas-copy-errorCopy failed, detail: { text }
NameDescription
default
actionsAction slot (copy/edit buttons etc.); position determined by actions-position

oas-paragraph

AttributeDescriptionTypeDefault
actions-positionAction bar position: start (before the text) / end (default, after the text); pair with slot="actions"stringend
alignAlignType
codeInline code style (monospace + light background)boolean
copy-textCustom content to copy (defaults to the current text)string
copyableShow a copy button that copies the text content on clickboolean
deleteStrikethrough (<del> semantics)boolean
depthText softening tier: 1 / 2 / 3 (progressively lighter); only effective with type="default"string
ellipsisSingle-line ellipsis when the text overflows its containerboolean
ellipsis-suffixSuffix preserved when ellipsized (e.g. an expand link); works with ellipsis / line-clampstring
italicItalic (<em> semantics)
levelHeading level (1-5)string3
line-clampNumber of lines before multi-line ellipsis (positive integer); combinable with ellipsis-suffixstring
markHighlighted mark (light yellow background, <mark> semantics)
numeric
strongBold (font-weight 600, <strong> semantics)
tagRender tag: replaces the default element (e.g. sub / sup / ins / em / strong)string
typeText type: default / secondary / success / warning / danger / disabledTextTypedefault
underlineUnderline
weightWeightType
EventDescription
oas-copyCopy succeeded, detail: { text }
oas-copy-errorCopy failed, detail: { text }
NameDescription
default
actionsAction slot (copy/edit buttons etc.); position determined by actions-position

Released under the MIT OR Apache-2.0 License.