Skip to content

setting-components/list-component

Contains a component that edits a reorderable list of strings.

Class Description
ListComponent A component that edits a reorderable list of strings: each item has move-up, move-down and remove buttons, and a row below the list adds an item, on its button or on Enter. ListComponent.newItemInputEl is a plain <input>, so a suggest can be attached to it; FolderListComponent and TagListComponent do exactly that. A subclass shapes what is added by overriding ListComponent.normalizeItem and how an item reads by overriding ListComponent.formatItem. An item already in the list is not added twice. You can add this component using SettingEx.addList. In order to add the styles for the component, use initPluginContext in your plugin’s onload() function. Alternatively, you can copy styles from https://unpkg.com/@mnaoumov/obsidian-lib/dist/styles.css.