Tabbed sections inside a plugin’s settings.
| Class |
Description |
| SettingsTabs |
Tabbed sections inside a plugin’s settings: a row of tab buttons and one panel, which renders only the selected tab. The arrow keys, Home and End move between tabs, as in the WAI-ARIA tabs pattern. ts public override display(): void \{ this.containerEl.empty(); new SettingsTabs(this.containerEl) .addTab(\{ id: 'general', name: 'General', render: (el) => this.renderGeneral(el) \}) .addTab(\{ id: 'advanced', name: 'Advanced', render: (el) => this.renderAdvanced(el) \}) .selectTab(this.lastTabId) .onTabChange((tabId) => \{ this.lastTabId = tabId; \}); \} 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. |