API reference
components/markdown
Import
Section titled “Import”import * as api from "@fungi.computer/caps/components/markdown";Exports
Section titled “Exports”| 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”type MarkdownProps = object;Props accepted by Markdown.
Properties
Section titled “Properties”children
Section titled “children”children: string;The Markdown source, including an unfinished streaming response.
className?
Section titled “className?”optional className?: string;Extra classes merged onto the rendered container.
components?
Section titled “components?”optional components?: MarkdownComponents;Element treatments; links use the shared policy, images are filtered first.
frontmatter?
Section titled “frontmatter?”optional frontmatter?: boolean;Strip a leading YAML frontmatter block before rendering. Defaults to true.
policy?
Section titled “policy?”optional policy?: "default" | "visitor";Visitor content allows only absolute HTTP(S) links and never loads images.
typography?
Section titled “typography?”optional typography?: "prose" | "inherit";Use Caps Prose, or inherit typography from the containing surface.
Markdown()function
Section titled “Markdown()”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.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
__namedParameters |
MarkdownProps |
Returns
Section titled “Returns”ReactNode