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
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.
<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.
- First note
- Second note
A paragraph after it.
<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.
縦書き
縦書きでは、段落の頭を一字下げて組む。
二つ目の段落も、同じく一字下げる。
<div className="writing-v">
<Prose>
<p>…</p>
</Prose>
</div>Props
children?- Type:
ReactNode - Default: -
| Prop | Type | Default |
|---|---|---|
children? | ReactNode | - |
Inherited attributes (except the ones set internally): HTMLAttributes<HTMLDivElement>