@k8ordo/ui

Prose

A container that puts the typesetting of body text back into HTML rendered from Markdown or MDX. Wrap an article’s body in it.

Import

ts
import { Prose } from '@k8ordo/ui';

Usage

The base styles reset headings, lists, margins and emphasis. Inside Prose, the typesetting of body text comes back: loose leading (leading-loose), proportional kana in headings (palt), and emphasis dots for Japanese em.

はじめに

本文の中の強い強調と強調、リンク、inline code が、読みやすく並ぶ。

  • リセットで消えた黒丸が戻る
  • 番号付きのリストも同じ

引用は罫線と控えめな文字色で示す。

tsx
<article>
  <Prose>
    <MDXContent />
  </Prose>
</article>

Components inside

Only bare elements, without a class, are typeset. Every component has a class, so it keeps its own look, and only the space around it follows the text. Map an MDX element to a component to give it the component’s look, or leave it bare to give it the text’s.

A paragraph before the component.

Information
  • First note
  • Second note

A paragraph after it.

tsx
<Prose>
  <p>A paragraph before the component.</p>
  <Alert message={['First note', 'Second note']} tone="info" />
  <p>A paragraph after it.</p>
</Prose>

Vertical writing

Under .writing-v, each paragraph’s first line is indented one character, as a book is set.

縦書き

縦書きでは、段落の頭を一字下げて組む。

二つ目の段落も、同じく一字下げる。

tsx
<div className="writing-v">
  <Prose>
    <p>…</p>
  </Prose>
</div>

Props

children?
Type: ReactNode
Default: -
PropTypeDefault
children?ReactNode-

Inherited attributes (except the ones set internally): HTMLAttributes<HTMLDivElement>

k8ordo

React libraries that use Baseline features without holding back.