Skip to main content

Overview

The MarkdownRenderable component renders Markdown content with full support for tables, code blocks, inline formatting, and more. It uses the marked parser internally and provides syntax highlighting for code blocks via Tree-sitter.

Basic Usage

Props

string
default:"''"
Markdown content to render.
SyntaxStyle
required
Syntax styling configuration for markdown elements and code blocks.
boolean
default:"true"
Hide formatting markers (e.g., **, *, “, []()).When true: **bold**boldWhen false: **bold** → **bold**
TreeSitterClient
Tree-sitter client for syntax highlighting code blocks. Uses default client if not provided.
boolean
default:"false"
Enable streaming mode for incremental content updates. Keeps trailing tokens unstable to handle incomplete content.
MarkdownTableOptions
Configuration for rendered markdown tables.
(token: Token, context: RenderNodeContext) => Renderable | undefined
Custom node renderer. Return a Renderable to override default rendering, or undefined to use default.

Table Options

'content' | 'full'
default:"'full'"
Column sizing strategy:
  • 'content': Columns fit to intrinsic content width
  • 'full': Columns expand to fill available width
'uniform' | 'proportional'
default:"'proportional'"
Column fitting method when shrinking constrained tables.
'none' | 'char' | 'word'
default:"'word'"
Text wrapping strategy for table cell content.
number
default:"0"
Padding applied on all sides of each table cell.
boolean
default:"true"
Enable/disable table border rendering.
BorderStyle
default:"'single'"
Border style for markdown tables ('single', 'double', etc.).
ColorInput
Border color. Defaults to conceal style color.
boolean
default:"true"
Enable selection support on markdown tables.

Supported Markdown Features

Headings

Text Formatting

Lists

Blockquotes

Code Blocks

Tables

Horizontal Rules

Methods

clearCache()

Force re-render by clearing the parse cache.

refreshStyles()

Re-render blocks with updated styles without rebuilding parse state.

Examples

GitHub Dark Theme

Markdown with Tables

Streaming Mode

Custom Table Styling

Conceal Toggle

Custom Node Renderer

Syntax Style Groups

Markdown uses the following syntax style groups:
  • markup.heading, markup.heading.1 through markup.heading.6
  • markup.bold, markup.strong
  • markup.italic
  • markup.list
  • markup.quote
  • markup.raw, markup.raw.block, markup.raw.inline
  • markup.link, markup.link.label, markup.link.url
  • punctuation.special
  • conceal (for concealed formatting markers)
  • default

Properties

content

Get or set the markdown content.

syntaxStyle

Get or set the syntax style.

conceal

Get or set conceal mode.

streaming

Get or set streaming mode.

tableOptions

Get or set table rendering options.

Performance

  • Uses AST-based parsing with marked for accurate Markdown parsing
  • Implements caching for repeated content to avoid redundant parsing
  • Smart width calculation accounting for concealed characters
  • Incremental rendering in streaming mode
  • Efficient table rendering with change detection
  • Text - Plain text display
  • Code - Syntax-highlighted code blocks
  • TextTable - Table component (used internally)