Content blocks

Text

The paragraph block: 16/24 rich text with inline marks, colors, links and mentions. Child blocks indent under it.

Plain text with bold, italic, underline, strikethrough and inline code.

Usage

  • Use the Text block for body paragraphs; it is the default block of every page.
  • Use inline marks (bold, italic, code, links, mentions) for emphasis inside a paragraph rather than separate blocks.
  • Nest child blocks under a paragraph only for content that belongs to it; use Toggle when it should be collapsible.
  • Don’t use Text with bold marks as a section title; use Heading instead.

Installation

Install the package (React 19):

terminal
npm install @krackedui/motion

Import the styles once, in your app entry or root layout:

/src/main.tsx
import '@krackedui/motion/styles.css';

Use it anywhere inside your app's <Theme> (see Installation):

/src/TextExample.tsx
import { BlockContent, TextBlock } from '@krackedui/motion';

export function TextExample() {
  return (
    <BlockContent>
      <TextBlock
        text={[
          { text: 'Plain text with ' },
          { text: 'bold', marks: { bold: true } },
          { text: ', ' },
          { text: 'italic', marks: { italic: true } },
          { text: ', ' },
          { text: 'underline', marks: { underline: true } },
          { text: ', ' },
          { text: 'strikethrough', marks: { strike: true } },
          { text: ' and ' },
          { text: 'inline code', marks: { code: true } },
          { text: '.' },
        ]}
      />
    </BlockContent>
  );
}

Examples

See the guide, ask @Alex, open 🗺️Roadmap before @Friday.

Text colors

Inline marks.color colors a run; a _background value highlights it.

gray brown orange yellow green blue purple pink red
gray brown orange yellow green blue purple pink red

Block color

Green text block
Blue background block

Nested children

Parent paragraph
Child paragraph, indented 24px

API Reference

TextBlock

Based on <div> and supports its props (except children, which is the nested blocks). Adds:

PropTypeDefault
text
RichText
renderLeaf
LeafRenderer
color
BlockColor
"default"
children
ReactNode
placeholder
string
" "

Accessibility

  • Links render as real <a href> elements with rel="noopener noreferrer".
  • Mentions are non-editable spans; their label is plain text, so screen readers read “@Alex”.
  • Colored text uses <c>-text-secondary tokens; check contrast for long passages of colored text on colored backgrounds.
© 2026 Motion. Internal documentation.