@financial-times/o3-editorial-typography

中文文档
3.2.2发布于 2025/06/30MITTypeScriptESM + CJS零依赖近 30 天下载 3395

Origami typography with design tokens

原始使用文档
文档目录11 节
  1. Overview
  2. Markup
  3. Heading styles
  4. Body and dropcap
  5. Quote
  6. Big Number
  7. Lists
  8. Theme modifiers
  9. Migration
  10. Contact
  11. Licence

o3-editorial-typography

Typographic styles for editorial content.

Overview

o3-editorial-typography provides typographic styles for editorial content. It supports the following brands:

  • core
  • sustainable-view

For UI typography see o3-typography.

Markup

o3-editorial-typography supports JSX templates for React users, or direct HTML. We recommend using JSX where possible.

Heading styles

Heading styles are available in 5 different types.

TypeSelectorNotes
Display.o3-editorial-typography-displayAdd the data-o3-editorial-underline attribute for an underline.
Headline.o3-editorial-typography-headline
Chapter.o3-editorial-typography-chapter
Subheading.o3-editorial-typography-subheading
Label.o3-editorial-typography-label

HTML

<h1 class="o3-editorial-typography-display" data-o3-editorial-underline>
    Large headline
</h1>

<h1 class="o3-editorial-typography-headline">Headline</h1>

<h2 class="o3-editorial-typography-chapter">Chapter</h2>

<h3 class="o3-editorial-typography-subheading">Subheading</h3>

<h3 class="o3-editorial-typography-label">Label</h3>

JSX

The same heading styles can be used in JSX environments as well by importing <Headline> component and applying the type modifier. The component is exported as a commonjs module as well as an es module. Depending your project setup, you can import the component from /cjs or /esm directory.

import { Headline } from '@financial-times/o3-editorial-typography/cjs';

<Headline type="display" underline={true}>Large headline</Headline>
<Headline type="headline">Headline</Headline>
<Headline type="chapter">Chapter</Headline>
<Headline type="subheading">Subheading</Headline>
<Headline type="label">Label</Headline>

<Headline> props:

| Prop | Type | Default | Description | | --------- | --------------------------------------------------------------- | ---------- | ------------------------------------------------------------ | | type | display | headline | chapter | subheading | label | headline | Type of the headline. | | theme | standard | inverse | - | Theme of the headline. | | underline | boolean | false | Adds an underline to the headline. Valid only for display. |

Body and dropcap

o3-foundation provides typography usecase tokens, including for editorial body copy (see o3-type-body-content-* classes). o3-editorial-typography builds on this by providing an optional drop cap style, o3-editorial-typography-drop-cap.

HTML

<p class="o3-editorial-typography-drop-cap o3-type-body-content-base">
    This is a small paragraph of text with a drop cap.
</p>

Topic Tag

Also called display tag, are category labels in the FT. Used in teasers (article cards) to indicate the category of a post. A topic tag is usually an anchor but does not have to be if there is no page to link to. Pure HTML markup is as follows:

<a class="o3-editorial-typography-topic-tag" href="#">Topic Link</a>
<span class="o-editorial-typography-topic-tag">Topic Without Link</span>

or with JSX import:

import {TopicTag} from '@financial-times/o3-editorial-typography/cjs'; // or /esm

<TopicTag href="#">Topic Link</TopicTag>
<TopicTag>Topic Without Link</TopicTag>

<TopicTag> props:

PropTypeDefaultDescription
hrefstring-URL to link the topic tag. The presence of href prop will determine rendered element tag
themestandard | inversestandardTheme of the topic tag.

Color and hover colour of the topic tag can be customized by using the following CSS variables:

VariableDescriptionDefault
--o3-editorial-typography-topic-tag-colorColour of the topic tagclaret - for core
--o3-editorial-typography-topic-tag-hover-colorHover colour of the topic tagclaret-30 - for core

Standfirst

Short intro below the headline that provides context about a post. Used in combination with a header in the topper component. Pure HTML markup is as follows:

<p class="o3-editorial-typography-standfirst">Standfirst</p>

or with JSX import:

import {Standfirst} from '@financial-times/o3-editorial-typography/cjs'; // or /esm

<Standfirst>Standfirst</Standfirst>;

<Standfirst> props:

PropTypeDefaultDescription
themestandard | inversestandardTheme of the standfirst.

Summary

Use to provide a concise summary of the article, offering a quick, high-level overview of the key points. It allows readers to grasp the main ideas without reading the entire article.

<p class="o3-editorial-typography-summary">Summary</p>

or with JSX import:

import {Summary} from '@financial-times/o3-editorial-typography/cjs'; // or /esm

<Summary>Summary</Summary>;

Caption

For additional information about a piece or image that should be less prominent. Pure HTML markup is as follows:

<figcaption class="o3-editorial-typography-caption">Caption</figcaption>

or with JSX import:

import {Caption} from '@financial-times/o3-editorial-typography/cjs'; // or /esm

<Caption>Caption</Caption>;

<Caption> props:

PropTypeDefaultDescription
themestandard | inversestandardTheme of the caption.

Byline

Byline is a composite component that includes author name, location and timestamp. It is used to display author details in the editorial content.

Author name is usually an anchor but does not have to be if there is no page to link to. Pure HTML markup is as follows:

<div class="o3-editorial-typography-byline">
    <a class="o3-editorial-typography-byline-author" href="#">Joe Doe</a> in
    London
    <time
        class="o3-editorial-typography-byline-timestamp"
        datetime="2019-10-11T20:51:54Z"
        title="October 11 2019 9:51 pm"
        >October 11 2019</time
    >
</div>

or with JSX import:

import {Byline} from '@financial-times/o3-editorial-typography/cjs'; // or /esm

<Byline>
    <a className="o3-editorial-typography-byline-author" href="#">
        Joe Doe
    </a>
    {''} in London {''}
    <time
        className="o3-editorial-typography-byline-timestamp"
        dateTime="2019-10-11T20:51:54Z"
        title="October 11 2019 9:51 pm">
        October 11 2019
    </time>
</Byline>;

<Byline> props:

PropTypeDefaultDescription
themestandard | inversestandardTheme of the byline.

Byline author colour and hover color can be customized by using the following CSS variables:

VariableDescriptionDefault
--o3-editorial-typography-byline-author-colorColour of the byline authorclaret - for core
--o3-editorial-typography-byline-author-hover-colorHover colour of the byline authorclaret-30 - for core

Quote

Quote is a composite component that includes quote text, author and caption. It is used to display direct words said by a person. It comes in two types: block and pull. The difference between the two is that block quote has vertical line on the left side of the quote, while pull quote has none. Pure HTML markup is as follows:

<blockquote class="o3-editorial-typography-blockquote">
    <p>
        Origami is about empowering developers of all levels to build robust,
        on-brand products ranging from simple static sites through to rich, dynamic
        web applications, to do it faster, to do it cheaper, and leave them more
        supportable and more maintainable.
    </p>
    <cite>
        <span class="o3-editorial-typography-blockquote__author">Quote Author</span>
        <span class="o3-editorial-typography-blockquote__caption"
            >Quote Source</span
        >
    </cite>
</blockquote>

or with JSX import:

import {Quote} from '@financial-times/o3-editorial-typography/cjs'; // or /esm

<Quote
    type="pull"
    quoteAuthor="Quote Author"
    quoteSource="Quote Source"
    quoteIcon={true}>
    Origami is about empowering developers of all levels to build robust, on-brand
    products ranging from simple static sites through to rich, dynamic web
    applications, to do it faster, to do it cheaper, and leave them more
    supportable and more maintainable.
</Quote>;

<Quote> props:

PropTypeDefaultDescription
typeblock | pullblockQuote text.
quoteAuthorstring-Author of the quote.
quoteSourcestring-Source of the quote.
quoteIconbooleantrueAdds an icon to the quote.
themestandard | inversestandardTheme of the quote.

Big Number

Big Number is a composite component that includes a large number and a label. It is used to describe a big number in the editorial content. Pure HTML markup is as follows:

<div class="o3-editorial-typography-big-number">
    <div class="o3-editorial-typography-big-number__title">£27,5m</div>
    <div class="o3-editorial-typography-big-number__content">
        Cost expected to increase by £13.7m a year.
    </div>
</div>
import {BigNumber} from '@financial-times/o3-editorial-typography/cjs'; // or /esm

<BigNumber title="£27,5m">
    Cost expected to increase by £13.7m a year.
</BigNumber>;

<BigNumber> props:

PropTypeDefaultDescription
titlestring-Title of the big number.
themestandard | inversestandardTheme of the big number.

Lists

o3-editorial-typography supports ordered and unordered lists. Use the classes o3-editorial-typography-list-ordered or o3-editorial-typography-list-unordered.

Lists may be used in different contexts they inherit font properties such as size and family. It's therefore required to apply font styles to a parent element. E.g. this could be done with o3-editorial-typography-body:

<div class="o3-editorial-typography-body">
    <ol class="o3-editorial-typography-list-ordered">
        <li>Lorem ipsum adipiscing elit.</li>
        <li>Sed feugiat turpis at massa tristique.</li>
        <li>Curabitu r accumsan elit luctus.</li>
    </ol>
</div>
import {Body, List} from '@financial-times/o3-editorial-typography/cjs'; // or /esm

<Body>
    <List
        type="ordered"
        listItems={[
            'Lorem ipsum adipiscing elit.',
            'Sed feugiat turpis at massa tristique.',
            'Curabitu r accumsan elit luctus.',
        ]}
    />
</Body>;

<List> props:

PropTypeDefaultDescription
typeordered | unordered-Type of the list.
themestandard | inversestandardTheme of the list.
listItemsArray<string>-List items.

Theme modifiers

All component can have theme modifiers. By default, the theme is standard and is not required. o3-editorial-typography also supports the inverse theme. Adding data-o3-theme="inverse" to the wrapper element or at the element itself will change the colour of the text to white. Inverse theme is supported by all exported components. Pure HTML markup is as follows:

<h3 class="o3-editorial-typography-label" data-o3-theme="inverse">Label</h3>

or if you are using JSX templates, theme can be passed as theme prop:

import {Heading} from '@financial-times/o3-editorial-typography/cjs';

<Heading type="headline" theme="inverse">
    Headline
</Heading>;

Migration

StateMajor VersionLast Minor ReleaseMigration guide
✨ active3N/Amigrate to v3
╳ deprecated22.3migrate to v2
╳ deprecated1-N/A

Contact

If you have any questions or comments about this component, or need help using it, please either raise an issue, visit #origami-support or email Origami Support.


Licence

This software is published by the Financial Times under the MIT licence.

版本与发布记录

@financial-times/o3-editorial-typography 共发布 21 个版本,首次发布于 2024/05/22;过去 12 个月发布了 0 个版本。

版本发布日期距今
3.2.2latest2025/06/301.4 年前
3.2.12025/04/151.6 年前
3.2.02025/04/101.6 年前
3.1.22025/03/271.6 年前
3.1.12025/03/071.7 年前
3.1.02025/03/061.7 年前

关于 @financial-times/o3-editorial-typography 的常见问题

@financial-times/o3-editorial-typography 是什么?

Origami typography with design tokens

如何安装 @financial-times/o3-editorial-typography?

在项目目录运行 npm install @financial-times/o3-editorial-typography,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:@financial-times/o3-foundation(^3.0.0)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@financial-times/o3-editorial-typography 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@financial-times/o3-editorial-typography 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

@financial-times/o3-editorial-typography 可以商用吗?

@financial-times/o3-editorial-typography 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@financial-times/o3-editorial-typography 的下载量有多少?

根据 npm 官方下载统计,@financial-times/o3-editorial-typography 在 2026/10/15 – 2026/11/13 这 30 天内被下载 3,395 次,日均约 113 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@financial-times/o3-editorial-typography 还在维护吗?

最新版本 3.2.2 发布于 2025/06/30(1.4 年前);至今共发布 21 个版本,其中过去 12 个月发布了 0 个;首次发布于 2024/05/22。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。