updated 2026-11-26·12 min read
Noether UI Components
Native SDK UI primitives including Button, TextInput, Toggle, Select, Slider, SettingCard/SettingBuilder, PageView, and SidebarActionHeader with full prop tables.
Native UI primitives and setting builders exported from the Noether SDK (src/sdk/index.ts and src/components/ui/). Every control uses --noether-* design tokens and flips state on click without transition delays.
Use these in custom settings tabs, modals, status bar widgets, and workspace views so extension UI matches the host.
1. Importing UI Primitives
All UI components and their TypeScript prop types are exported from the Noether SDK:
import {
Button,
TextInput,
Toggle,
Select,
Slider,
SettingCard,
SettingItem,
SettingBuilder,
PageView,
SidebarActionHeader,
SidebarActionButton,
CollapseAllButton,
SortDropdown,
} from 'noether';
2. Button Component
The Button component provides standard desktop button behaviors with unified sizing, variant styling, and keyboard accessibility.
import React from 'react';
import { Button } from 'noether';
export const MyActionToolbar: React.FC = () => {
return (
<div className="flex items-center gap-2">
<Button
variant="primary"
size="md"
onClick={() => console.log('Saved')}
>
Save Note
</Button>
<Button
variant="default"
size="md"
onClick={() => console.log('Exported')}
>
Export
</Button>
<Button
variant="danger"
size="sm"
onClick={() => console.log('Deleted')}
>
Delete
</Button>
</div>
);
};
Props Reference
| Prop | Type | Default | Description |
|---|---|---|---|
variant | 'default' | 'primary' | 'danger' | 'ghost' | 'default' | Visual style variant. |
size | 'sm' | 'md' | 'md' | Padding and font sizing. |
disabled | boolean | false | Disables pointer interactions and dims opacity. |
icon | React.ReactNode | undefined | Optional icon element rendered beside the label. |
iconPosition | 'left' | 'right' | 'left' | Side on which icon is rendered relative to children. |
onClick | (e: React.MouseEvent) => void | undefined | Click handler callback. |
3. TextInput Component
TextInput is a single-line text input extending standard HTML input attributes with an optional monospace styling flag.
import React, { useState } from 'react';
import { TextInput } from 'noether';
export const SearchField: React.FC = () => {
const [query, setQuery] = useState('');
return (
<TextInput
value={query}
onChange={(e) => setQuery(e.target.value)}
placeholder="Filter tasks..."
isMono
/>
);
};
Props Reference
| Prop | Type | Default | Description |
|---|---|---|---|
value | string | number | readonly string[] | undefined | Input value (inherited from React.InputHTMLAttributes<HTMLInputElement>). |
onChange | (e: React.ChangeEvent<HTMLInputElement>) => void | undefined | Change event handler. |
placeholder | string | undefined | Input placeholder text. |
isMono | boolean | false | Applies monospace font styling (font-mono). |
4. Toggle / ToggleSwitch Component
Toggle (exported as both Toggle and ToggleSwitch) provides a boolean switch control. Pair it with SettingItem when you need a title and description label.
import React, { useState } from 'react';
import { Toggle } from 'noether';
export const AutoSaveSetting: React.FC = () => {
const [enabled, setEnabled] = useState(true);
return (
<Toggle
checked={enabled}
onChange={(val) => setEnabled(val)}
title="Enable Auto-Save"
size="md"
/>
);
};
Props Reference
| Prop | Type | Default | Description |
|---|---|---|---|
checked | boolean | Required | Active toggle state. |
onChange | (checked: boolean) => void | Required | State change callback. |
title | string | undefined | Accessible title attribute on the toggle button. |
size | 'sm' | 'md' | 'md' | Toggle switch dimensions. |
disabled | boolean | false | Disables interaction. |
className | string | '' | Additional CSS classes for the button wrapper. |
5. Select / CustomSelect Component
A native desktop dropdown selector matching Noether’s theme popovers and keyboard navigation.
import React, { useState } from 'react';
import { Select, SelectOption } from 'noether';
const VIEW_OPTIONS: SelectOption[] = [
{ value: 'source', label: 'Raw Markdown' },
{ value: 'live', label: 'Live Preview' },
{ value: 'reading', label: 'Reading View' },
];
export const ViewModeSelector: React.FC = () => {
const [mode, setMode] = useState('live');
return (
<Select
value={mode}
options={VIEW_OPTIONS}
onChange={(newVal) => setMode(newVal)}
/>
);
};
6. Slider Component
A continuous or stepped numerical range input with a real-time value display badge.
import React, { useState } from 'react';
import { Slider } from 'noether';
export const SpacingSetting: React.FC = () => {
const [fontSize, setFontSize] = useState(16);
return (
<Slider
value={fontSize}
min={12}
max={24}
step={1}
onChange={(val) => setFontSize(val)}
/>
);
};
7. SettingCard & SettingItem
Settings pages in Noether follow an organized card-and-row structure. SettingCard acts as a group container, while SettingItem pairs a title and description with an interactive control slot.
import React, { useState } from 'react';
import { SettingCard, SettingItem, Toggle, TextInput } from 'noether';
export const ExtensionSettingsTab: React.FC = () => {
const [apiKey, setApiKey] = useState('');
const [debugMode, setDebugMode] = useState(false);
return (
<div className="flex flex-col gap-4">
<SettingCard title="General Configuration" description="Configure core parameters for this extension.">
<SettingItem
name="API Key"
description="Your personal API access token."
>
<TextInput
value={apiKey}
onChange={(e) => setApiKey(e.target.value)}
placeholder="noether_..."
/>
</SettingItem>
<SettingItem
name="Debug Logging"
description="Print detailed event traces to the developer console."
>
<Toggle
checked={debugMode}
onChange={(val) => setDebugMode(val)}
/>
</SettingItem>
</SettingCard>
</div>
);
};
8. Fluent SettingBuilder API
For extensions that prefer a procedural settings builder instead of authoring raw SettingCard and SettingItem JSX, Noether exports SettingBuilder:
import React from 'react';
import { ExtensionSettingTab, SettingBuilder, NoetherApp } from 'noether';
export class MySettingsTab implements ExtensionSettingTab {
id = 'my-extension-settings';
name = 'Word Counter Settings';
render(app: NoetherApp): React.ReactNode {
return (
<div className="flex flex-col gap-2">
{new SettingBuilder()
.setName('Status Bar Visibility')
.setDesc('Show live word count indicator in the bottom status bar.')
.addToggle((toggle) => {
toggle
.setValue(true)
.onChange((val) => {
console.log('Status bar visibility toggled:', val);
});
})
.build()}
{new SettingBuilder()
.setName('Target Word Count')
.setDesc('Daily writing goal in words.')
.addText((text) => {
text
.setPlaceholder('500')
.setValue('1000')
.onChange((val) => {
console.log('New target:', val);
});
})
.build()}
{new SettingBuilder()
.setName('Display Mode')
.setDesc('Choose how counts are formatted.')
.addDropdown((dropdown) => {
dropdown
.addOptions({ words: 'Words', chars: 'Characters' })
.setValue('words')
.onChange((val) => {
console.log('Display mode:', val);
});
})
.build()}
</div>
);
}
}
9. Application Modal Dialogs
Noether provides built-in dialog helpers on app.workspace for user confirmations and prompts:
app.workspace.openConfirmDialog({ title, message, confirmText, onConfirm }): Displays a confirmation modal with confirm and cancel buttons.app.workspace.openInputDialog({ title, message, placeholder, onConfirm }): Requests user text input.app.workspace.showToast(message, 'info' | 'success' | 'warning'): Displays non-intrusive toast alerts in the bottom-right corner.
10. PageView Component
The PageView component provides the full-page shell for custom workspace views, tabs, and documents. It coordinates the active-tab cutout mask passthrough, sticky floating PageSubHeader, dynamic scroll dissolve effects, custom scrollbar tracks, and responsive padding.
import React from 'react';
import { PageView } from 'noether';
export const CustomAnalyticsView: React.FC = () => {
return (
<PageView
title="Vault Analytics"
icon={<span className="text-base">📊</span>}
showDocOptions
customDocMenuActions={[
{
id: 'export-csv',
label: 'Export to CSV',
onClick: () => console.log('Exporting...'),
},
]}
customRightActions={
<button className="text-xs px-2.5 py-1 bg-neutral-800 hover:bg-neutral-700 text-neutral-300 rounded border border-neutral-700">
Sync
</button>
}
>
<div className="p-8 max-w-4xl mx-auto space-y-6">
<h2 className="text-lg font-semibold text-neutral-100">Overview</h2>
<p className="text-sm text-neutral-400">
Analytics for your vault notes, links, and tags.
</p>
</div>
</PageView>
);
};
Features
- Active Tab Cutout Passthrough: In Noether’s tabbed workspace, tabs feature curved wing cutouts.
PageViewrenders withdata-main="true"andbg-[var(--noether-bg-tab-active,var(--noether-bg-main))]so the active tab merges into the page content without visual breaks. - Floating Sticky Subheader: Positions the subheader floating at
top: var(--noether-header-offset, 0px)with navigation history buttons (back/forward), icon, title, document options menu, and custom left/right action slots. - Dynamic Scroll Transparency: When the user scrolls down, the subheader transitions its background to transparent and adds subtle text and icon drop-shadows, maintaining contrast above scrolling text while maximizing visible workspace area.
- Scrollbar Offset: Applies
.scrollbar-track-offset-subheaderso the native scrollbar track begins below the floating subheader rather than clashing against subheader buttons. - Non-Scrollable Mode: Setting
scrollable={false}disables scrolling for canvas or graph interfaces.
Props Reference
| Prop | Type | Default | Description |
|---|---|---|---|
title | string | undefined | View title rendered in the subheader. |
icon | React.ReactNode | undefined | Icon element rendered beside the title. |
document | DocumentItem | null | undefined | Active document bound to bookmark, reading mode, and option controls. |
subHeader | React.ReactNode | undefined | Custom subheader element replacing the default PageSubHeader. |
hideSubHeader | boolean | false | When true, omits the subheader entirely. |
customLeftActions | React.ReactNode | undefined | Custom React controls rendered on the left side of the subheader. |
customRightActions | React.ReactNode | undefined | Custom React controls rendered on the right side of the subheader. |
showDocOptions | boolean | false | Displays the three-dot document options menu in the subheader. |
customDocMenuActions | DocMenuAction[] | undefined | Additional menu items appended to the subheader document options menu. |
scrollable | boolean | true | When true, renders a scroll container. When false, content fills the shell for canvas or spatial layouts. |
readableLineLength | boolean | false | When true, constrains content to readable line length matching document view settings. |
className | string | '' | Additional CSS classes applied to the root container. |
children | React.ReactNode | undefined | View body content rendered in the viewport. |
11. SidebarActionHeader & SidebarActionButton Components
SidebarActionHeader and SidebarActionButton provide the shared toolbar container and button controls for custom sidebar views and dock panels (Files, Outlines, Backlinks, Tags, Properties, History, and extension views). Using these components maintains baseline Y-alignment with the vertical Action Rail (y = 49px), uniform 28x28px button footprints with 16px icons, tight 2px gaps (gap-0.5), and immediate click response with no animation delay.
import React, { useState } from 'react';
import {
SidebarActionHeader,
SidebarActionButton,
CollapseAllButton,
SortDropdown,
} from 'noether';
import { HugeiconsIcon } from '@hugeicons/react';
import { PlusSignIcon, Search01Icon } from '@hugeicons/core-free-icons';
export const CustomSidebarView: React.FC = () => {
const [isSearchOpen, setIsSearchOpen] = useState(false);
const [isCollapsed, setIsCollapsed] = useState(false);
const [sortOrder, setSortOrder] = useState('alpha-asc');
const sortOptions = [
{ id: 'alpha-asc', label: 'Alphabetical: A-Z' },
{ id: 'alpha-desc', label: 'Alphabetical: Z-A' },
];
return (
<div className="flex flex-col h-full select-none text-xs">
{/* Standardized Optical Toolbar */}
<SidebarActionHeader borderBottom={false}>
<SidebarActionButton
onClick={() => console.log('Create item')}
title="Create item (Ctrl+N)"
icon={<PlusSignIcon size={16} />}
/>
<SortDropdown
value={sortOrder}
onChange={setSortOrder}
options={sortOptions}
/>
<CollapseAllButton
isCollapsed={isCollapsed}
onToggle={() => setIsCollapsed(!isCollapsed)}
collapsedTitle="Expand all items"
expandedTitle="Collapse all items"
/>
<SidebarActionButton
onClick={() => setIsSearchOpen(!isSearchOpen)}
isActive={isSearchOpen}
title={isSearchOpen ? 'Close search' : 'Search items'}
icon={<Search01Icon size={16} />}
/>
</SidebarActionHeader>
{/* View Body */}
<div className="flex-1 overflow-y-auto p-2">
{/* View content */}
</div>
</div>
);
};
Layout and Sizing Rules
- Header Alignment: The top icon in the Action Rail / Ribbon aligns at
y = 49px(pt-[41px]header padding +pt-2inner container padding).SidebarActionHeaderappliesh-9 mt-1(36px height + 4px top margin + 4px inner button offset =y = 49px). This prevents awkward vertical staggering between the sidebar header and ribbon. - Button Sizing & Density:
SidebarActionButtonandCollapseAllButtonrender atw-7 h-7 rounded-md(28x28px) with16pxicon size andgap-0.5(2px) horizontal spacing, matching the dock control cluster and window header tools. - Instant Responsiveness: Hover states and active toggles engage immediately without animation delays, keeping desktop controls responsive.
Props Reference
SidebarActionHeaderProps, SidebarActionButtonProps, CollapseAllButtonProps & SortDropdownProps
SidebarActionHeaderProps
| Prop | Type | Default | Description |
|---|---|---|---|
children | React.ReactNode | undefined | Action buttons, dropdowns, and controls rendered in the header. |
borderBottom | boolean | false | When true, renders a subtle bottom border separator (border-[var(--noether-border-base)]). |
className | string | '' | Additional CSS classes applied to the container. |
SidebarActionButtonProps
| Prop | Type | Default | Description |
|---|---|---|---|
icon | React.ReactNode | undefined | Primary icon element (rendered at 16px by convention). |
isActive | boolean | false | When true, highlights the button with active card background styling. |
disabled | boolean | false | Disables pointer events and dims opacity to 35%. |
title | string | undefined | Tooltip title shown on hover and used for accessibility labels. |
onClick | (e: React.MouseEvent) => void | undefined | Click event handler callback. |
className | string | '' | Additional CSS classes. |
CollapseAllButtonProps
| Prop | Type | Default | Description |
|---|---|---|---|
isCollapsed | boolean | - | Whether the target items are currently all collapsed. |
onToggle | () => void | - | Toggle handler callback. |
disabled | boolean | false | Dims button when no collapsible items exist. |
collapsedTitle | string | 'Expand all' | Tooltip when items are collapsed (clicking will expand). |
expandedTitle | string | 'Collapse all' | Tooltip when items are expanded (clicking will collapse). |
size | number | 16 | Icon glyph size in pixels. |
SortDropdownProps<T>
| Prop | Type | Default | Description |
|---|---|---|---|
value | T | - | Currently selected sort option ID. |
onChange | (value: T) => void | - | Sort change callback. |
options | SortOption<T>[] | - | Array of sort option descriptors ({ id, label, section? }). |
disabled | boolean | false | Dims button when items list is empty. |
title | string | 'Change sort order' | Tooltip label. |
12. Related Reading & References
- UI Extension Points: Register custom views with
this.registerView(). - CSS Variables & Design Tokens: Style custom controls using Noether’s theme variables.
- Noether SDK API Reference: Complete method signatures and hook definitions.
- Events & Relational Storage: Coordinate UI actions with database events.
- Model Context Protocol (MCP) Tools: Expose extension capabilities to AI agent copilots.