# MarkdownEditorProps (@salmonui/editors/markdown-editor)

> The MarkdownEditorProps interface of @salmonui/editors/markdown-editor.

Canonical: https://salmonui.dev/docs/reference/editors/markdown-editor/MarkdownEditorProps

```ts
import type { MarkdownEditorProps } from '@salmonui/editors/markdown-editor';
```

Entry index: https://salmonui.dev/docs/reference/editors/markdown-editor (Markdown with every symbol of the entry: https://salmonui.dev/docs/reference/editors/markdown-editor.md).

## Reference

Kind: interface

```ts
interface MarkdownEditorProps extends TextareaProps {
    readonly value?: string | undefined;
    readonly defaultValue?: string | undefined;
    readonly onValueChange?: ((value: string, event: MarkdownValueChangeEvent) => void) | undefined;
    readonly toolbar?: readonly MarkdownToolbarItem[] | undefined;
    readonly toolbarOverflow?: 'menu' | 'wrap' | 'scroll' | undefined;
    readonly stickyToolbar?: boolean | undefined;
    readonly preview?: MarkdownPreviewMode | undefined;
    readonly defaultPreview?: MarkdownPreviewMode | undefined;
    readonly onPreviewChange?: ((mode: MarkdownPreviewMode, event: MarkdownToggleEvent) => void) | undefined;
    readonly renderPreview?: ((markdown: string) => ReactNode) | undefined;
    readonly fullscreen?: boolean | undefined;
    readonly defaultFullscreen?: boolean | undefined;
    readonly onFullscreenChange?: ((fullscreen: boolean, event: MarkdownToggleEvent) => void) | undefined;
    readonly onUpload?: ((file: File, options: {
        readonly signal: AbortSignal;
    }) => PromiseLike<MarkdownUploadResult>) | undefined;
    readonly syntax?: Partial<MarkdownSyntax> | undefined;
    readonly showCount?: boolean | undefined;
    readonly resizable?: boolean | undefined;
    readonly tabIndents?: boolean | undefined;
    readonly undoLimit?: number | undefined;
    readonly locale?: string | undefined;
    readonly localeText?: Partial<MarkdownEditorLocaleText> | undefined;
    readonly onBeforeCommand?: ((event: MarkdownBeforeCommandEvent) => void) | undefined;
    readonly onCommand?: ((event: MarkdownCommandEvent) => void) | undefined;
    readonly className?: string | undefined;
    readonly style?: CSSProperties | undefined;
    readonly classNames?: Partial<Record<MarkdownEditorPart, string>> | undefined;
    readonly styles?: Partial<Record<MarkdownEditorPart, CSSProperties>> | undefined;
    readonly ref?: Ref<MarkdownEditorApi> | undefined;
}
```

Members (28):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `value` | `readonly value?: string \| undefined;` | optional | Markdown source (controlled). |
| `defaultValue` | `readonly defaultValue?: string \| undefined;` | optional |  |
| `onValueChange` | `readonly onValueChange?: ((value: string, event: MarkdownValueChangeEvent) => void) \| undefined;` | optional | Every edit: typing, a command, a form reset. |
| `toolbar` | `readonly toolbar?: readonly MarkdownToolbarItem[] \| undefined;` | optional | Toolbar entries; default `MARKDOWN_DEFAULT_TOOLBAR`. An empty array hides the toolbar. |
| `toolbarOverflow` | `readonly toolbarOverflow?: 'menu' \| 'wrap' \| 'scroll' \| undefined;` | optional | Items that do not fit: in a More menu (default), wrapped, or scrolled. |
| `stickyToolbar` | `readonly stickyToolbar?: boolean \| undefined;` | optional | Keeps the toolbar visible while the page scrolls. |
| `preview` | `readonly preview?: MarkdownPreviewMode \| undefined;` | optional |  |
| `defaultPreview` | `readonly defaultPreview?: MarkdownPreviewMode \| undefined;` | optional |  |
| `onPreviewChange` | `readonly onPreviewChange?: ((mode: MarkdownPreviewMode, event: MarkdownToggleEvent) => void) \| undefined;` | optional |  |
| `renderPreview` | `readonly renderPreview?: ((markdown: string) => ReactNode) \| undefined;` | optional | Renders the preview; receives the deferred source. No parser is bundled. |
| `fullscreen` | `readonly fullscreen?: boolean \| undefined;` | optional |  |
| `defaultFullscreen` | `readonly defaultFullscreen?: boolean \| undefined;` | optional |  |
| `onFullscreenChange` | `readonly onFullscreenChange?: ((fullscreen: boolean, event: MarkdownToggleEvent) => void) \| undefined;` | optional |  |
| `onUpload` | `readonly onUpload?: ((file: File, options: {     readonly signal: AbortSignal; }) => PromiseLike<MarkdownUploadResult>) \| undefined;` | optional | Uploads an image file from the image dialog or a paste. |
| `syntax` | `readonly syntax?: Partial<MarkdownSyntax> \| undefined;` | optional | Marker overrides per command. |
| `showCount` | `readonly showCount?: boolean \| undefined;` | optional | Shows the character count (with `maxLength`, `n / max`). |
| `resizable` | `readonly resizable?: boolean \| undefined;` | optional | Vertical resize handle on the textarea. Default true. |
| `tabIndents` | `readonly tabIndents?: boolean \| undefined;` | optional | Tab and Shift+Tab indent instead of moving focus. Default false. |
| `undoLimit` | `readonly undoLimit?: number \| undefined;` | optional | Steps of the internal history used where native undo is unavailable. Default 100. |
| `locale` | `readonly locale?: string \| undefined;` | optional | Locale of uppercase / lowercase. |
| `localeText` | `readonly localeText?: Partial<MarkdownEditorLocaleText> \| undefined;` | optional |  |
| `onBeforeCommand` | `readonly onBeforeCommand?: ((event: MarkdownBeforeCommandEvent) => void) \| undefined;` | optional |  |
| `onCommand` | `readonly onCommand?: ((event: MarkdownCommandEvent) => void) \| undefined;` | optional |  |
| `className` | `readonly className?: string \| undefined;` | optional |  |
| `style` | `readonly style?: CSSProperties \| undefined;` | optional |  |
| `classNames` | `readonly classNames?: Partial<Record<MarkdownEditorPart, string>> \| undefined;` | optional |  |
| `styles` | `readonly styles?: Partial<Record<MarkdownEditorPart, CSSProperties>> \| undefined;` | optional |  |
| `ref` | `readonly ref?: Ref<MarkdownEditorApi> \| undefined;` | optional |  |
