Interface OpenableTriggerConfig

Per-trigger based configuration. Can either be given as an object as the value of the OpenableProperties.triggers map, or it can be set as a string configuration in the data-lisn-<name>-trigger data attribute. See getWidgetConfig for the syntax.

<div data-lisn-collapsible-trigger="auto-close
| icon=right
| icon-closed=arrow-down
| icon-open=x"
></div>
interface OpenableTriggerConfig {
    autoClose?: boolean;
    className?: string | string[];
    hover?: boolean;
    icon?: false | Offset;
    iconClosed?:
        | "arrow-left"
        | "arrow-right"
        | "arrow-up"
        | "arrow-down"
        | "plus";
    iconOpen?: | "x"
    | "arrow-left"
    | "arrow-right"
    | "arrow-up"
    | "arrow-down"
    | "minus";
    id?: string;
    preventDefault?: boolean;
}

Properties

autoClose?: boolean

Override the widget's OpenableProperties.autoClose for this trigger.

undefined // Widget default
className?: string | string[]

Class name(s) for the trigger. Will result in the trigger element, which could be a wrapper around the original element you passed, getting these classes.

undefined
hover?: boolean

Open the openable when this trigger is hovered.

If the device is touch and OpenableProperties.autoClose is enabled, the widget will be closed shortly after the pointer leaves both the trigger and the root element.

false
icon?: false | Offset

Override the widget's CollapsibleConfig.icon for this trigger.

Currently only relevant for Collapsibles.

undefined // Widget default
iconClosed?: "arrow-left" | "arrow-right" | "arrow-up" | "arrow-down" | "plus"

Override the widget's CollapsibleConfig.iconClosed for this trigger.

Currently only relevant for Collapsibles.

undefined // Widget default
iconOpen?:
    | "x"
    | "arrow-left"
    | "arrow-right"
    | "arrow-up"
    | "arrow-down"
    | "minus"

Override the widget's CollapsibleConfig.iconOpen for this trigger.

Currently only relevant for Collapsibles.

undefined // Widget default
id?: string

The DOM ID of the trigger. Will result in the trigger element, which could be a wrapper around the original element (as in the case of Collapsible you passed, getting this ID.

IMPORTANT: If the trigger element already has an ID and is not being wrapped, then this will override the ID and it won't be restored on destroy.

undefined
preventDefault?: boolean

Whether to prevent default click action.

true