Skip to main content
The markdown editor component provides a markdown editing interface with preview.

Basic Usage

use Filament\Forms\Components\MarkdownEditor;

MarkdownEditor::make('content')

Available Methods

toolbarButtons
method
Sets which toolbar buttons are available.
MarkdownEditor::make('content')
    ->toolbarButtons([
        'bold',
        'italic',
        'strike',
        'link',
        'heading',
        'blockquote',
        'codeBlock',
        'bulletList',
        'orderedList',
        'table',
    ])
disableToolbarButtons
method
Disables specific toolbar buttons.
MarkdownEditor::make('content')
    ->disableToolbarButtons(['table', 'codeBlock'])
fileAttachmentsDisk
method
Sets the disk for file attachments.
MarkdownEditor::make('content')
    ->fileAttachmentsDisk('s3')
fileAttachmentsDirectory
method
Sets the directory for file attachments.
MarkdownEditor::make('content')
    ->fileAttachmentsDirectory('attachments')
fileAttachmentsVisibility
method
Sets visibility for file attachments.
MarkdownEditor::make('content')
    ->fileAttachmentsVisibility('private')
disableGrammarly
method
Disables Grammarly.
MarkdownEditor::make('content')
    ->disableGrammarly()

Common Patterns

README Editor

MarkdownEditor::make('readme')
    ->toolbarButtons([
        'bold',
        'italic',
        'link',
        'heading',
        'blockquote',
        'codeBlock',
        'bulletList',
        'orderedList',
    ])
    ->required()

Documentation Editor

MarkdownEditor::make('content')
    ->fileAttachmentsDisk('public')
    ->fileAttachmentsDirectory('docs-images')
    ->required()

Simple Markdown

MarkdownEditor::make('notes')
    ->toolbarButtons([
        'bold',
        'italic',
        'link',
        'bulletList',
        'orderedList',
    ])

Build docs developers (and LLMs) love