Trilium Frontend API
    Preparing search index...

    Interface ViewRootElementDefinition

    A description of the DOM element used as an editor's editable root, accepted by module:core/editor/editorconfig~RootConfig#element config.root.element.

    const element: ViewRootElementDefinition = {
    name: 'h1',
    classes: [ 'article-title' ],
    styles: { 'font-weight': 'bold' },
    attributes: { 'data-id': '123' }
    };

    class and style may also be passed as strings inside attributes as a shorthand:

    const element: ViewRootElementDefinition = {
    name: 'h1',
    attributes: { class: 'article-title', style: 'font-weight: bold' }
    };
    interface ViewRootElementDefinition {
        attributes?: Record<string, string>;
        classes?: string | string[];
        name?: string;
        styles?: Record<string, string>;
    }
    Index

    Properties

    attributes?: Record<string, string>

    Additional DOM attributes to apply to the editable element.

    classes?: string | string[]

    Class name or array of class names to apply to the editable element. Each name can be provided as a string.

    name?: string

    The DOM tag name to use. Defaults to 'div' when not provided, so integrators can keep the default element and still specify #classes, #styles, or #attributes.

    styles?: Record<string, string>

    Inline styles to apply to the editable element as a record of style properties.