Trilium Frontend API
    Preparing search index...

    Interface FormDropdownList<T>

    Construct a type with the properties of T except for those in type K.

    interface FormDropdownList<T> {
        buttonClassName?: string;
        buttonProps?: Partial<HTMLAttributes<HTMLButtonElement> & DataAttributes>;
        className?: h.JSX.Signalish<string>;
        currentValue: string;
        descriptionProperty?: keyof T;
        disabled?: boolean;
        dividerBeforeProperty?: keyof T;
        dropdownContainerClassName?: string;
        dropdownContainerRef?: MutableRef<HTMLDivElement>;
        dropdownContainerStyle?: CSSProperties;
        dropdownOptions?: Partial<Options>;
        dropdownRef?: MutableRef<Dropdown>;
        forceShown?: boolean;
        hideToggleArrow?: boolean;
        iconAction?: boolean;
        iconProperty?: keyof T;
        id?: h.JSX.Signalish<string>;
        isStatic?: boolean;
        keyProperty: keyof T;
        mobileBackdrop?: boolean;
        mobileBottomSheet?: boolean;
        noDropdownListStyle?: boolean;
        noSelectButtonStyle?: boolean;
        onHidden?: () => void;
        onShown?: () => void;
        portalToBody?: boolean;
        text?: ComponentChildren;
        title?: string;
        titleOptions?: Partial<Options>;
        titlePosition?: "top" | "bottom" | "left" | "right";
        titleProperty: keyof T;
        titleSuffixProperty?: keyof T;
        values: T[];
        onChange(newValue: string): void;
    }

    Type Parameters

    • T

    Hierarchy (View Summary)

    Index
    buttonClassName?: string
    className?: h.JSX.Signalish<string>
    currentValue: string
    descriptionProperty?: keyof T
    disabled?: boolean
    dividerBeforeProperty?: keyof T

    Property marking an item as starting a group of its own, drawing a divider above it. For a list whose entries are not all the same sort of choice, e.g. one that changes more than the others do.

    dropdownContainerClassName?: string
    dropdownContainerRef?: MutableRef<HTMLDivElement>
    dropdownContainerStyle?: CSSProperties
    dropdownOptions?: Partial<Options>
    dropdownRef?: MutableRef<Dropdown>
    forceShown?: boolean
    hideToggleArrow?: boolean
    iconAction?: boolean

    If set to true, then the dropdown button will be considered an icon action (without normal border and sized for icons only).

    iconProperty?: keyof T

    Property holding the icon of an item, e.g. bx bx-calendar. Shown on the items and on the button.

    id?: h.JSX.Signalish<string>
    isStatic?: boolean
    keyProperty: keyof T
    mobileBackdrop?: boolean
    mobileBottomSheet?: boolean

    On a phone, show the menu as a sheet rising from the bottom of the screen over a dimmed page, the way the app's other mobile menus appear. No effect on a desktop layout.

    Prefer this to setting the pieces by hand. A menu left to place itself on mobile lands as a narrow box adrift in the middle of the page — Popper computes an offset that the app's own body.mobile .dropdown-menu { position: fixed } then measures from somewhere else — and one opened inside a dialog needs portalToBody besides, since a transformed .modal-dialog is both the box a fixed menu is placed against and a stacking context the backdrop, painting above the whole modal, would otherwise dim the menu through.

    noDropdownListStyle?: boolean

    Drop the tn-dropdown-list class the menu otherwise carries by default.

    That class exists for scrollable menus: it moves the theme's backdrop blur off the menu's ::before layer — which a scrollable menu would scroll away with its content — and onto the menu element itself. The element-level filter is the fragile one, though: opened over note content it blurs nothing at all, leaving the menu merely translucent and reading as see-through over anything dark.

    So set this on any menu that doesn't scroll (i.e. nearly every action menu) to keep it on the working pseudo-element layer.

    noSelectButtonStyle?: boolean
    onHidden?: () => void
    onShown?: () => void
    portalToBody?: boolean

    Render the dropdown menu into document.body instead of nesting it next to the toggle.

    Use this when an ancestor establishes a containment/backdrop root (e.g. container-type, transform, filter) which would otherwise flatten the menu's backdrop-filter blur into a flat tint. The menu is wrapped in a <div class="tn-dropdown-portal {className}"> so any CSS scoped under that class keeps applying even though the menu no longer lives inside the toggle's wrapper, and so the menu outranks whatever stacking context it was lifted out of.

    title?: string
    titleOptions?: Partial<Options>
    titlePosition?: "top" | "bottom" | "left" | "right"
    titleProperty: keyof T
    titleSuffixProperty?: keyof T

    Property to show as a small suffix next to the title

    values: T[]
    • Parameters

      • newValue: string

      Returns void