Code.svelte

view source

Declarations
#

Code
#

Code.svelte view source

accepts children

import Code from '@fuzdev/fuz_code/Code.svelte';

lang?

type string
optional default 'svelte'

children?

type Snippet<[]> & Snippet<[markup: string]>
optional

content?

The source code to syntax highlight.

type string
optional

dangerous_raw_html?

type string
optional

inline?

Whether to render as inline code instead of a block.

type boolean
optional default false

wrap?

Whether to wrap long lines in block code (white-space: pre-wrap instead of pre). Wraps at whitespace — long unbroken tokens (URLs, hashes) still scroll horizontally. Ignored for inline code.

type boolean
optional default false

nomargin?

Whether to disable the default margin-bottom on block code (var(--space_lg) when not :last-child).

type boolean
optional default false

syntax_styler?

Custom SyntaxStyler instance, e.g. with different languages registered.

optional default syntax_styler_global

intersects

SvelteHTMLElements['code']

Depends on
#