import panel as pn import param pn.extension('texteditor') wysiwyg = pn.widgets.TextEditor(placeholder='Enter some text') wysiwyg wysiwyg.value wysiwyg.value = '

A title

' pn.config.sizing_mode = 'stretch_width' # Flat list of options flat = pn.widgets.TextEditor(toolbar=['bold', 'italic', 'underline']) # Grouped options grouped = pn.widgets.TextEditor(toolbar=[['bold', 'italic'], ['link', 'image']]) # Dropdown of options dropdown = pn.widgets.TextEditor(toolbar=[{'size': [ 'small', False, 'large', 'huge' ]}]) # Full configuration full_config = pn.widgets.TextEditor(toolbar=[ ['bold', 'italic', 'underline', 'strike'], # toggled buttons ['blockquote', 'code-block'], [{ 'header': 1 }, { 'header': 2 }], # custom button values [{ 'list': 'ordered'}, { 'list': 'bullet' }], [{ 'script': 'sub'}, { 'script': 'super' }], # superscript/subscript [{ 'indent': '-1'}, { 'indent': '+1' }], # outdent/indent [{ 'direction': 'rtl' }], # text direction [{ 'size': ['small', False, 'large', 'huge'] }], # custom dropdown [{ 'header': [1, 2, 3, 4, 5, 6, False] }], [{ 'color': [] }, { 'background': [] }], # dropdown with defaults from theme [{ 'font': [] }], [{ 'align': [] }], ['clean'] # remove formatting button ]) pn.Column( pn.Row(flat, grouped, dropdown), full_config ) pn.widgets.TextEditor(mode='bubble', value='Highlight me to edit formatting', margin=(40, 0, 0, 0), height=200, width=400) editor = pn.widgets.TextEditor(placeholder='Enter some text') pn.Row(editor.controls(jslink=True, sizing_mode='fixed'), editor)