Trilium Frontend API
    Preparing search index...

    Interface ViewElementObjectDefinition

    A plain object that describes a view element in a way that a concrete, exact view element could be created from that description.

    const viewDefinition = {
    name: 'h1',
    classes: [ 'foo', 'bar' ]
    };

    Above describes a view element:

    <h1 class="foo bar"></h1>
    

    An example with styles and attributes:

    const viewDefinition = {
    name: 'span',
    styles: {
    'font-size': '12px',
    'font-weight': 'bold'
    },
    attributes: {
    'data-id': '123'
    }
    };

    Describes:

    <span style="font-size:12px;font-weight:bold" data-id="123"></span>
    
    interface ViewElementObjectDefinition {
        attributes?: Record<string, string>;
        classes?: ArrayOrItem<string>;
        name: string;
        priority?: number;
        styles?: Record<string, string>;
    }
    Index

    Properties

    attributes?: Record<string, string>

    Object with key-value pairs representing attributes. Each object key represents attribute name. Value under that key must be a string.

    classes?: ArrayOrItem<string>

    Class name or array of class names to match. Each name can be provided in a form of string.

    name: string

    View element name.

    priority?: number

    Element's module:engine/view/attributeelement~ViewAttributeElement#priority priority.

    styles?: Record<string, string>

    Object with key-value pairs representing styles. Each object key represents style name. Value under that key must be a string.