dash_mp_components.Scrollspy¶
- class dash_mp_components.Scrollspy(menuGroups: Sequence | None = None, activeClassName: str | None = None, menuClassName: str | None = None, menuGroupLabelClassName: str | None = None, menuItemContainerClassName: str | None = None, menuItemClassName: str | None = None, offset: Annotated[SupportsFloat | SupportsInt | SupportsComplex, _NumberSchema] | None = None, **kwargs)[source]¶
Bases:
ComponentA Scrollspy component. Component for building in-page navigation menus with scrollspy functionality
Keyword arguments:
- activeClassName (string; optional):
Class name applied to active links in the menu (default: ‘is-active’).
- menuClassName (string; optional):
Class name applied to the <aside> that contains the whole menu (default: ‘menu’).
- menuGroupLabelClassName (string; optional):
Class name applied to all menu group labels (default: ‘menu-label’).
- menuGroups (list; optional):
An array of MenuGroup items that is used to build the menu and its links. Each MenuGroup has an optional label and a required ‘items’ array of MenuItems. Each MenuItem has a label that is rendered in the menu and a targetId that is the id of the element it should link to. Do not include ‘#’ in targetId. example: [ {label: ‘…’, items: [ {label: ‘…’, targetId: ‘…’}, {label: ‘…’, targetId: ‘…’, items: [ {label: ‘…’, targetId: ‘…’} }] ]} ].
- menuItemClassName (string; optional):
Class name applied to the <li> of each menu item (default: ‘’).
- menuItemContainerClassName (string; optional):
Class name applied to each <ul> of menu items (default: ‘menu-list’).
- offset (number; optional):
An integer to determine the scroll offset from an item that will trigger it active (default: -20).
- __init__(menuGroups: Sequence | None = None, activeClassName: str | None = None, menuClassName: str | None = None, menuGroupLabelClassName: str | None = None, menuItemContainerClassName: str | None = None, menuItemClassName: str | None = None, offset: Annotated[SupportsFloat | SupportsInt | SupportsComplex, _NumberSchema] | None = None, **kwargs)¶
Methods
__init__([menuGroups, activeClassName, ...])to_plotly_json()Attributes
REQUIREDUNDEFINEDavailable_wildcard_properties