A plugin is a component with no DOM element of its own. Instead of rendering into the page, it attaches behaviour to the element of the component that hosts it — much like a directive. You list plugins under plugins/ in a view.tree; they run alongside the view but never show up in its sub.1$my_app$mol_view2 plugins /3<= Theme $mol_theme_auto4<= Search_key $mol_hotkey5 key *6 K?<=> open_search?7 sub /8<= Content $my_contentBecause a plugin shares its host's element, it can add event listeners, attributes, or reactive side-effects to that element without wrapping it in extra markup.
$mol_hotkey — bind keyboard shortcuts. key*escape?<=>close? runs close on Escape; set mod_ctrltrue to require Ctrl/⌘.$mol_theme_auto — apply a light/dark theme to the host subtree.$mol_nav — arrow-key navigation across a list of components (keys_y, current_y).$mol_speech — speech recognition input.
A plugin extends $mol_plugin (which is itself element-less) and typically wires an event to a handler:1$my_autosave$mol_plugin2 event *3^4 input?<=> save?nullAttach it to any view via that view's plugins/ list, and it augments that view's element.Edit this page on GitHubWas this helpful?YesNoPreviousCookbookNextModule metadataOn this pagePlugins you'll use oftenWriting oneType to search the documentation.