Blazorise Markdown API

Explore the Blazorise Markdown API reference for parameters, events, methods, and related types.

For examples and usage guidance, see the Markdown documentation.

API

Parameters

ParameterDefaultType
AriaDescribedBy—string

Specifies the aria-describedby attribute value.
When set, this value is rendered as-is and overrides help and validation message ids generated by Field and Validation.
AriaInvalid—string

Specifies the aria-invalid attribute value.
When set, this value is rendered as-is and overrides the validation-derived aria-invalid state.
AriaLabelledBy—string

Specifies the aria-labelledby attribute value.
When set, this value is rendered as-is. Some non-labelable controls can otherwise derive it automatically from a parent FieldLabel or FieldsLabel.
AriaRequiredfalsebool

Specifies the aria-required attribute value.
When set, this value overrides the required-field state resolved from the parent Validation.
AutoDownloadFontAwesomenullbool?

If set to true, force downloads Font Awesome (used for icons). If set to false, prevents downloading.
Autofocusfalsebool

Set's the focus to the component after the rendering is done.
AutoRefreshnullMarkdownAutoRefresh

Useful, when initializing the editor in a hidden DOM node. If set to { delay: 300 }, it will check every 300 ms if the editor is visible and if positive, call CodeMirror's refresh().
AutosavenullMarkdownAutosave

Saves the text that's being written and will load it back in the future. It will forget the text when the form it's contained in is submitted.
BlockStylesnullMarkdownBlockStyles

Customize how certain buttons that style blocks of text behave.
ChildContentnullRenderFragment

Specifies the content to be rendered inside this Markdown.
Direction"ltr"string

rtl or ltr. Changes text direction to support right-to-left languages. Defaults to ltr.
Disabledfalsebool

Add the disabled boolean attribute on an input to prevent user interactions and make it appear lighter.
DisableProgressReportfalsebool

Determines whether report progress should be disabled. By enabling this setting, ImageUploadProgressed and ImageUploadWritten callbacks won't be called. Internal file progress won't be tracked.

This setting can speed up file transfer considerably.

ErrorMessagesnullMarkdownErrorMessages

Errors displayed to the user, using the errorCallback option, where #image_name#, #image_size# and #image_max_size# will replaced by their respective values, that can be used for customization or internationalization.
FeedbacknullRenderFragment

Placeholder for validation messages.
ForceSyncfalsebool

If set to true, force text changes made in EasyMDE to be immediately stored in original text area. Defaults to false.
HideIcons["side-by-side", "fullscreen"]string[]

An array of icon names to hide. Can be used to hide specific icons shown by default without completely customizing the toolbar.
ImageAccept"image/png, image/jpeg"string

A comma-separated list of mime-types used to check image type before upload (note: never trust client, always check file types at server-side). Defaults to image/png, image/jpeg.
ImageCSRFToken—string

CSRF token to include with AJAX call to upload image. For instance used with Django backend.
ImageMaxSize1024 * 1024 * 2long

Maximum image size in bytes, checked before upload (note: never trust client, always check image size at server-side). Defaults to 1024*1024*2 (2Mb).
ImagePathAbsolute—string

If set to true, will treat imageUrl from imageUploadFunction and filePath returned from imageUploadEndpoint as an absolute rather than relative path, i.e. not prepend window.location.origin to it.
ImageTextsnullMarkdownImageTexts

Texts displayed to the user (mainly on the status bar) for the import image feature, where #image_name#, #image_size# and #image_max_size# will replaced by their respective values, that can be used for customization or internationalization.
ImageUploadEndpoint—string

The endpoint where the images data will be sent, via an asynchronous POST request. The server is supposed to save this image, and return a json response.
IndentWithTabstruebool

If set to false, indent using spaces instead of tabs. Defaults to true.
InputStyle—string

textarea or contenteditable. Defaults to textarea for desktop and contenteditable for mobile. contenteditable option is necessary to enable nativeSpellcheck.
InsertTextsnullMarkdownInsertTexts

Customize how certain buttons that insert text behave. Takes an array with two elements. The first element will be the text inserted before the cursor or highlight, and the second element will be inserted after. For example, this is the default link value: ["[", "](http://)"].
LineNumbersfalsebool

If set to true, enables line numbers in the editor.
LineWrappingtruebool

If set to false, disable line wrapping. Defaults to true.
MaxHeight—string

Sets fixed height for the composition area. minHeight option will be ignored. Should be a string containing a valid CSS value like "500px". Defaults to undefined.
MaxUploadImageChunkSize20 * 1024int

Specifies the max chunk size when uploading the file. Take note that if you're using IFileEntry,CancellationToken) you're provided with a stream and should configure the chunk size when handling with the stream.
https://docs.microsoft.com/en-us/aspnet/core/blazor/javascript-interoperability/call-dotnet-from-javascript?view=aspnetcore-6.0#stream-from-javascript-to-net
MinHeight"300px"string

Sets the minimum height for the composition area, before it starts auto-growing. Should be a string containing a valid CSS value like "500px". Defaults to "300px".
NativeSpellchecktruebool

If set to false, disable native spell checker. Defaults to true.
OnScreenKeyboardfalsebool

Enables the on-screen keyboard for this input component. When not explicitly set, the global accessibility option is used.
When omitted, uses the global accessibility setting and enabled input types.
OnScreenKeyboardEnterKeyBehaviorInput-dependentOnScreenKeyboardEnterKeyBehavior

Specifies how the on-screen keyboard enter key should behave for this input component.
Possible values:DefaultNewLineSubmitHideKeyDown
When omitted, uses the cascading override, then the global option, then the input component's behavior.
OnScreenKeyboardLayoutInput-dependentOnScreenKeyboardLayout

Specifies the on-screen keyboard layout for this input component. When not explicitly set, the global accessibility option is used.
Possible values:TextNumericDecimalEmailUrlTelephone
When omitted, uses the global default layout, then the input component's layout.
OnScreenKeyboardShowModeFocusOnScreenKeyboardShowMode

Gets or sets how the on-screen keyboard is shown for this input.
Possible values:DefaultFocusManual
When omitted, uses the global show mode; Default resolves to Focus.
ParsingConfignullMarkdownParsingConfig

Adjust settings for parsing the Markdown during editing (not previewing).
Placeholder—string

If set, displays a custom placeholder message.
PreviewClass"editor-preview"string

A space-separated strings that will be applied to the preview screen when activated. Defaults to "editor-preview".
PreviewImagesInEditorfalsebool

EasyMDE will show preview of images, false by default, preview for images will appear only for images on separate lines.
PromptTextsnullMarkdownPromptTexts

Customize the text used to prompt for URLs.
PromptURLsfalsebool

If set to true, a JS alert window appears asking for the link or image URL. Defaults to false.
ReadOnlyfalsebool

Add the readonly boolean attribute on an input to prevent modification of the input’s value.
RenderingConfignullMarkdownRenderingConfig

Adjust settings for parsing the Markdown during previewing (not editing).
ScrollbarStyle"native"string

Chooses a scrollbar implementation. The default is "native", showing native scrollbars. The core library also provides the "null" style, which completely hides the scrollbars. Addons can implement additional scrollbar models.
SegmentFetchTimeoutTimeSpan.FromMinutes( 1 )TimeSpan

Specifies the Segment Fetch Timeout when uploading the file.
ShortcutsnullMarkdownShortcuts

Keyboard shortcuts associated with this instance. Defaults to the array of shortcuts.
ShowIcons["code", "table"]string[]

An array of icon names to show. Can be used to show specific icons hidden by default without completely customizing the toolbar.
SideBySideFullscreenfalsebool

If set to false, allows side-by-side editing without going into fullscreen. Defaults to false.
SizeDefaultSize?

Sets the size of the input control.
When omitted, uses the parent Addons size, then the theme input size, then Size.Default.
SpellCheckertruebool

If set to false, disable the spell checker. Defaults to true
Statusnullstring[]

If set to empty array, hide the status bar. Defaults to the array of built-in status bar items. Optionally, you can set an array of status bar items to include, and in what order.
StyleSelectedTexttruebool

If set to false, remove the CodeMirror-selectedtext class from selected lines. Defaults to true.
SyncSideBySidePreviewScrolltruebool

If set to false, disable syncing scroll in side by side mode. Defaults to true.
TabIndexnullint?

If defined, indicates that its element can be focused and can participates in sequential keyboard navigation.
TabSize2int

If set, customize the tab size. Defaults to 2.
Theme"easymde"string

Override the theme. Defaults to easymde.
ToolbarnullRenderFragment

[Optional] Gets or sets the content of the toolbar.
ToolbarButtonClassPrefix"mde"string

Adds a prefix to the toolbar button classes when set. For example, a value of `"mde"` results in `"mde-bold"` for the Bold button.
ToolbarTipstruebool

If set to false, disable toolbar button tips. Defaults to true.
UnorderedListStyle"*"string

can be *, - or +. Defaults to *.
UploadImagetruebool

If set to true, enables the image upload functionality, which can be triggered by drag-drop, copy-paste and through the browse-file window (opened when the user click on the upload-image icon). Defaults to true.
ValuenullTValue

Specifies the value inside the input field.
ValueExpressionnullExpression<Func<TValue>>

Specifies an expression that identifies the input value.

Events

EventType
BlurEventCallback<FocusEventArgs>

The blur event fires when an element has lost focus.
CustomButtonClickedEventCallback<MarkdownButtonEventArgs>

Occurs after the custom toolbar button is clicked.
CustomValidationValueFunc<TValue>

Used to provide custom validation value on which the validation will be processed with the Validator handler.
Should be used carefully as it's only meant for some special cases when input is used in a wrapper component, like Autocomplete or SelectList.
ErrorCallbackFunc<string, Task>

A callback function used to define how to display an error message. Defaults to (errorMessage) => alert(errorMessage).
FocusInEventCallback<FocusEventArgs>

Notifies when the input box gains focus.
FocusOutEventCallback<FocusEventArgs>

Notifies when the input box loses focus.
ImageUploadChangedFunc<FileChangedEventArgs, Task>

Occurs every time the selected image has changed.
ImageUploadEndedFunc<FileEndedEventArgs, Task>

Provides a callback when an individual image upload has ended.
ImageUploadProgressedFunc<FileProgressedEventArgs, Task>

Notifies the progress of image being written to the destination stream.
ImageUploadStartedFunc<FileStartedEventArgs, Task>

Provides a callback when an individual image upload has started.
ImageUploadWrittenFunc<FileWrittenEventArgs, Task>

Occurs every time the part of image has being written to the destination stream.
KeyDownEventCallback<KeyboardEventArgs>

Notifies when a key is pressed down while the control has focus.
KeyPressEventCallback<KeyboardEventArgs>

Notifies when a key is pressed while the control has focus.
KeyUpEventCallback<KeyboardEventArgs>

Notifies when a key is released while the control has focus.
OnFocusEventCallback<FocusEventArgs>

Notifies when the input box gains or loses focus.
PreviewRenderFunc<string, Task<string>>

Custom function for parsing the plaintext Markdown and returning HTML. Used when user previews.
ValueChangedEventCallback<TValue>

Occurs after value has changed.

Methods

MethodReturnParameters
GetValueAsyncTask<string>—

Gets the markdown value.
OpenReadStreamStreamIFileEntry fileEntry, CancellationToken cancellationToken

Opens the stream for reading the uploaded file.
RemoveFileEntryTaskIFileEntry fileEntry, CancellationToken cancellationToken

Removes the file entry from js dictionary.
SetValueAsyncTaskstring value

Sets the markdown value.
UpdateFileEndedAsyncTaskIFileEntry fileEntry, bool success, FileInvalidReason fileInvalidReason

Notifies the component that file upload has ended.
UpdateFileProgressAsyncTaskIFileEntry fileEntry, long progressProgress

Updated the component with the latest upload progress.
UpdateFileStartedAsyncTaskIFileEntry fileEntry

Notifies the component that file upload is about to start.
UpdateFileWrittenAsyncTaskIFileEntry fileEntry, long position, byte[] data

Updates component with the latest file data.
WriteToStreamAsyncTaskIFileEntry fileEntry, Stream stream, CancellationToken cancellationToken

Writes the file data to the target stream.
ShowOnScreenKeyboardTaskbool focus

Shows the on-screen keyboard for this input.
FocusTaskbool scrollToElement

Sets the focus on the underline element.
RevalidateTask—

Forces the Validation (if any is used) to re-validate with the new custom or internal value.
On this page