Skip to main content

Editor

Function Editor 

Source
pub fn Editor(_: EditorProps) -> Element
Expand description

A rich text editor: a formatting toolbar over an editable document. Toolbar buttons report aria-pressed across the whole selection, so a half-bold selection reads as not bold and a click bolds the rest. The document is reported as HTML through onchange.

ยงProps

For details, see the props struct definition.

  • label : AccessibleName

    Names the document.

  • initial : TrustedHtml

    The starting document, read once.

  • placeholder : Option<String>

    Shown while the document is empty.

  • state : EditorState
  • readonly : bool
  • marks : Vec<Mark>

    The mark buttons, in order.

  • blocks : Vec<BlockTag>

    The block buttons, after a divider.

  • onchange : Option<EventHandler<String>>
  • onmarks : Option<EventHandler<Vec<Mark>>>

    The marks covering the whole selection, as the toolbar shows them.

  • class : Option<String>
  • attributes : Vec<Attribute>