Skip to content

Typography

Basic text writing, including headings, body text, lists, and more.

When To Use

  • When need to display a title or paragraph contents in Articles/Blogs/Notes.
  • When you need copyable/editable/ellipsis texts.

Examples

Title

vue
<template>
  <a-typography-title>h1. Ant Design</a-typography-title>
  <a-typography-title :level="2">h2. Ant Design</a-typography-title>
  <a-typography-title :level="3">h3. Ant Design</a-typography-title>
  <a-typography-title :level="4">h4. Ant Design</a-typography-title>
  <a-typography-title :level="5">h5. Ant Design</a-typography-title>
</template>

Text

vue
<template>
  <a-space direction="vertical">
    <a-typography-text>Ant Design (default)</a-typography-text>
    <a-typography-text type="secondary">Ant Design (secondary)</a-typography-text>
    <a-typography-text type="success">Ant Design (success)</a-typography-text>
    <a-typography-text type="warning">Ant Design (warning)</a-typography-text>
    <a-typography-text type="danger">Ant Design (danger)</a-typography-text>
    <a-typography-text disabled>Ant Design (disabled)</a-typography-text>
    <a-typography-text mark>Ant Design (mark)</a-typography-text>
    <a-typography-text code>Ant Design (code)</a-typography-text>
    <a-typography-text keyboard>Ant Design (keyboard)</a-typography-text>
    <a-typography-text underline>Ant Design (underline)</a-typography-text>
    <a-typography-text delete>Ant Design (delete)</a-typography-text>
    <a-typography-text strong>Ant Design (strong)</a-typography-text>
    <a-typography-text italic>Ant Design (italic)</a-typography-text>
  </a-space>
</template>

Interactive

vue
<template>
  <a-space direction="vertical">
    <a-typography-paragraph editable>
      This is an editable text.
    </a-typography-paragraph>
    <a-typography-paragraph copyable>
      This is a copyable text.
    </a-typography-paragraph>
    <a-typography-paragraph copyable="{ text: 'Hello, Ant Design!' }">
      Replace copy text.
    </a-typography-paragraph>
  </a-space>
</template>

Ellipsis

vue
<template>
  <a-space direction="vertical" style="width: 100%">
    <a-typography-paragraph
      :ellipsis="{ rows: 2, expandable: true, symbol: 'more' }"
    >
      Ant Design, a design language for background applications, is refined by Ant UED Team.
      Ant Design, a design language for background applications, is refined by Ant UED Team.
      Ant Design, a design language for background applications, is refined by Ant UED Team.
      Ant Design, a design language for background applications, is refined by Ant UED Team.
      Ant Design, a design language for background applications, is refined by Ant UED Team.
      Ant Design, a design language for background applications, is refined by Ant UED Team.
    </a-typography-paragraph>
  </a-space>
</template>

API

Typography.Text

PropertyDescriptionTypeDefaultVersion
codeCode stylebooleanfalse
copyableWhether to be copyable, customize it via setting an objectboolean | copyablefalse
deleteDeleted line stylebooleanfalse
disabledDisabled contentbooleanfalse
editableIf editable. Can control edit state when is objectboolean | editablefalse
ellipsisDisplay ellipsis when text overflowsbooleanfalse
keyboardKeyboard stylebooleanfalse
markMarked stylebooleanfalse
strongBold stylebooleanfalse
italicItalic stylebooleanfalse
typeContent typesecondary | success | warning | danger-
underlineUnderlined stylebooleanfalse

Typography.Title

PropertyDescriptionTypeDefaultVersion
codeCode stylebooleanfalse
copyableWhether to be copyable, customize it via setting an objectboolean | copyablefalse
deleteDeleted line stylebooleanfalse
disabledDisabled contentbooleanfalse
editableIf editable. Can control edit state when is objectboolean | editablefalse
ellipsisDisplay ellipsis when text overflows, can configure rows and expandable by using objectboolean | ellipsisfalse
levelSet content importance, same as h1, h2, h3, h4, h5number: 1, 2, 3, 4, 51
markMarked stylebooleanfalse
typeContent typesecondary | success | warning | danger-
underlineUnderlined stylebooleanfalse

Typography.Paragraph

PropertyDescriptionTypeDefaultVersion
codeCode stylebooleanfalse
copyableWhether to be copyable, customize it via setting an objectboolean | copyablefalse
deleteDeleted line stylebooleanfalse
disabledDisabled contentbooleanfalse
editableIf editable. Can control edit state when is objectboolean | editablefalse
ellipsisDisplay ellipsis when text overflows, can configure rows and expandable by using objectboolean | ellipsisfalse
markMarked stylebooleanfalse
strongBold stylebooleanfalse
typeContent typesecondary | success | warning | danger-
underlineUnderlined stylebooleanfalse

Released under the MIT License.