Skip to content
API reference

components/markdown

Import
import * as api from "@fungi.computer/caps/components/markdown";
Kind Export Description
type alias MarkdownProps Props accepted by Markdown.
function Markdown() Shared Markdown renderer with safe links, images and highlighted code. Documents use Caps Prose; containing surfaces can supply their own typography and element treatments. Replacing the source renders streaming partial Markdown.

MarkdownPropstype alias

Section titled “MarkdownProps”
Signature
type MarkdownProps = object;

Props accepted by Markdown.

Signature
children: string;

The Markdown source, including an unfinished streaming response.

Signature
optional className?: string;

Extra classes merged onto the rendered container.

Signature
optional components?: MarkdownComponents;

Element treatments; links use the shared policy, images are filtered first.

Signature
optional frontmatter?: boolean;

Strip a leading YAML frontmatter block before rendering. Defaults to true.

Signature
optional policy?: "default" | "visitor";

Visitor content allows only absolute HTTP(S) links and never loads images.

Signature
optional typography?: "prose" | "inherit";

Use Caps Prose, or inherit typography from the containing surface.

Signature
function Markdown(__namedParameters): ReactNode;

Shared Markdown renderer with safe links, images and highlighted code. Documents use Caps Prose; containing surfaces can supply their own typography and element treatments. Replacing the source renders streaming partial Markdown.

Parameter Type
__namedParameters MarkdownProps

ReactNode