@servicenow/sdk - v4.7.0
    Preparing search index...
    interface SPMenu {
        $id: string | number | ExplicitKey<string>;
        $meta?: { installMethod?: "first install" | "demo" | "once" };
        $override?: Record<string, string | number | boolean>;
        active?: boolean;
        advancedPlaceholderDimensions?: boolean;
        asyncLoad?: boolean;
        asyncLoadDeviceType?: string;
        asyncLoadTrigger?: "viewport" | "parallel";
        color?: BootstrapColor;
        column?: string | Record<"sp_column">;
        css?: string;
        cssClass?: string;
        glyph?: string;
        id?: string;
        items?: SPMenuItem[];
        order?: number;
        placeholderConfigurationScript?: string;
        placeholderDimensions?: JsonSerializable;
        placeholderTemplate?: string;
        preservePlaceholderSize?: boolean;
        protectionPolicy?: "read" | "protected";
        roles?: (string | Role | Record<"sys_user_role">)[];
        shortDescription?: string;
        size?: SPInstanceSize;
        title?: string;
        url?: string;
        widget?: string | Record<"sp_widget"> | SPWidget;
        widgetParameters?: JsonSerializable;
    }
    Index

    Properties

    $id: string | number | ExplicitKey<string>
    $meta?: { installMethod?: "first install" | "demo" | "once" }

    Type Declaration

    • OptionalinstallMethod?: "first install" | "demo" | "once"

      Map a record to an output folder that loads only in specific circumstances. 'first install' -> 'unload' (only loaded when plugin is first registered), 'demo' -> 'unload.demo' (only loaded when demo data is loaded), 'once' -> 'apply_once' (scripts that are only applied once)

    $override?: Record<string, string | number | boolean>

    Set properties not directly supported by this API.

    active?: boolean

    Whether this instance is rendered on the page. Set to false to hide the instance without deleting it.

    true
    
    advancedPlaceholderDimensions?: boolean

    Enables fine-grained control over placeholder width and height via placeholderDimensions. Only relevant when asyncLoad is true.

    false
    
    asyncLoad?: boolean

    Defers rendering of this widget until the async trigger condition is met. Use with asyncLoadTrigger to control when loading begins.

    false
    
    asyncLoadDeviceType?: string

    Comma-separated list of device types for which async loading is applied.

    'mobile,tablet'
    
    asyncLoadTrigger?: "viewport" | "parallel"

    Controls when async loading is triggered:

    • 'viewport' — loads the widget when it is scrolled into the visible viewport.
    • 'parallel' — loads the widget immediately in parallel with other page content.
    'viewport'
    

    Bootstrap contextual color applied to the instance header band. Valid values: 'default', 'primary', 'success', 'info', 'warning', 'danger'.

    'default'
    
    column?: string | Record<"sp_column">

    Reference to the sp_column record this instance belongs to (used internally).

    css?: string

    CSS scoped to this widget instance, applied in addition to the widget's own CSS.

    cssClass?: string

    Additional CSS class name added to the instance wrapper element.

    glyph?: string

    FontAwesome icon class (without the fa- prefix) shown alongside the instance title.

    'home', 'user', 'cog'
    
    id?: string

    Unique string identifier for the instance record (sp_instance.id).

    items?: SPMenuItem[]

    The menu items for the instance (maps to sp_rectangle_menu_item)

    order?: number

    Sort order within the column. Lower values appear higher/earlier.

    placeholderConfigurationScript?: string

    Server-side script that returns placeholder dimension config dynamically. Evaluated on page load before the widget is asynchronously loaded.

    placeholderDimensions?: JsonSerializable

    JSON object specifying explicit width/height for the async placeholder. Only used when advancedPlaceholderDimensions is true.

    '{"width":"100%","height":"300px"}'
    
    placeholderTemplate?: string

    AngularJS HTML template rendered as the placeholder while async content loads.

    preservePlaceholderSize?: boolean

    Maintains the placeholder element's height while async content is loading, preventing layout shift (CLS). Only relevant when asyncLoad is true.

    false
    
    protectionPolicy?: "read" | "protected"

    Controls edit/view access for other developers after the application is installed.

    • read: Others can see the script logic but not change it.
    • protected: Others cannot change this record.
    • Omit to allow other developers to customize this record.
    roles?: (string | Role | Record<"sys_user_role">)[]

    Restricts visibility of this instance to users with at least one of the specified roles. If empty, the instance is visible to all users who can access the page.

    shortDescription?: string

    Brief admin-facing description of the instance's purpose. Not displayed to end users.

    Visual size of the instance card in the portal designer. Valid values: 'sm', 'md', 'lg', 'xl'.

    'md'
    
    title?: string

    Heading text displayed above the widget instance in the portal UI.

    url?: string

    URL override applied to the instance link/title.

    widget?: string | Record<"sp_widget"> | SPWidget

    The widget (sp_widget) to render at this position on the page.

    widgetParameters?: JsonSerializable

    JSON key-value pairs passed to the widget's server and client scripts as options. Keys correspond to the widget's optionSchema property names.