Skip to content

API Reference

A centralized reference for all Incremark types and components.

Components

<IncremarkContent />

The main component for rendering Markdown content.

Props (IncremarkContentProps):

PropTypeDefaultDescription
contentstring-The Markdown string to render (content mode).
stream() => AsyncGenerator<string>-Async generator function for streaming content (stream mode).
isFinishedbooleanfalseWhether the content generation is finished (required for content mode).
incremarkOptionsUseIncremarkOptions-Configuration options for the parser and typewriter effect.
componentsComponentMap{}Custom components to override default element rendering.
customContainersRecord<string, Component>{}Custom container components for ::: name syntax.
customCodeBlocksRecord<string, Component>{}Custom code block components for specific languages.
codeBlockConfigsRecord<string, CodeBlockConfig>{}Configuration for code blocks (e.g., takeOver).
showBlockStatusbooleanfalseWhether to visualize block processing status (pending/completed).
pendingClassstring'incremark-pending'CSS class applied to pending blocks.

<AutoScrollContainer />

A container that automatically scrolls to the bottom when content updates.

Props:

PropTypeDefaultDescription
enabledbooleantrueWhether auto-scroll functionality is active.
thresholdnumber50Distance in pixels from bottom to trigger auto-scroll.
behaviorScrollBehavior'instant'Scroll behavior ('auto', 'smooth', 'instant').

Composables / Hooks

useIncremark

The core hook for advanced usage and fine-grained control.

Options (UseIncremarkOptions):

OptionTypeDefaultDescription
gfmbooleantrueEnable GitHub Flavored Markdown support.
mathbooleantrueEnable Math (KaTeX) support.
htmlTreebooleantrueEnable parsing of raw HTML tags.
containersbooleantrueEnable custom container syntax :::.
typewriterTypewriterOptions-Configuration for typewriter effect.

Returns (UseIncremarkReturn):

PropertyTypeDescription
blocksRef<Block[]>Reactive array of parsed blocks with stable IDs.
append(chunk: string) => voidAppend new content chunk to the parser.
render(content: string) => voidRender a complete or updated content string.
reset() => voidReset parser state and clear all blocks.
finalize() => voidMark all blocks as completed.
isDisplayCompleteRef<boolean>Whether the typewriter effect has finished displaying all content.

Configuration Types

TypewriterOptions

OptionTypeDefaultDescription
enabledbooleanfalseEnable typewriter effect.
charsPerTicknumber | [number, number]2Characters to reveal per tick (or range).
tickIntervalnumber50ms between ticks.
effect'none' | 'fade-in' | 'typing''none'Animation style.
cursorstring`''`