lietzsche;noether
Pages

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

PropTypeDefaultDescription
variant'default' | 'primary' | 'danger' | 'ghost''default'Visual style variant.
size'sm' | 'md''md'Padding and font sizing.
disabledbooleanfalseDisables pointer interactions and dims opacity.
iconReact.ReactNodeundefinedOptional icon element rendered beside the label.
iconPosition'left' | 'right''left'Side on which icon is rendered relative to children.
onClick(e: React.MouseEvent) => voidundefinedClick 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

PropTypeDefaultDescription
valuestring | number | readonly string[]undefinedInput value (inherited from React.InputHTMLAttributes<HTMLInputElement>).
onChange(e: React.ChangeEvent<HTMLInputElement>) => voidundefinedChange event handler.
placeholderstringundefinedInput placeholder text.
isMonobooleanfalseApplies 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

PropTypeDefaultDescription
checkedbooleanRequiredActive toggle state.
onChange(checked: boolean) => voidRequiredState change callback.
titlestringundefinedAccessible title attribute on the toggle button.
size'sm' | 'md''md'Toggle switch dimensions.
disabledbooleanfalseDisables interaction.
classNamestring''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. PageView renders with data-main="true" and bg-[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-subheader so 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

PropTypeDefaultDescription
titlestringundefinedView title rendered in the subheader.
iconReact.ReactNodeundefinedIcon element rendered beside the title.
documentDocumentItem | nullundefinedActive document bound to bookmark, reading mode, and option controls.
subHeaderReact.ReactNodeundefinedCustom subheader element replacing the default PageSubHeader.
hideSubHeaderbooleanfalseWhen true, omits the subheader entirely.
customLeftActionsReact.ReactNodeundefinedCustom React controls rendered on the left side of the subheader.
customRightActionsReact.ReactNodeundefinedCustom React controls rendered on the right side of the subheader.
showDocOptionsbooleanfalseDisplays the three-dot document options menu in the subheader.
customDocMenuActionsDocMenuAction[]undefinedAdditional menu items appended to the subheader document options menu.
scrollablebooleantrueWhen true, renders a scroll container. When false, content fills the shell for canvas or spatial layouts.
readableLineLengthbooleanfalseWhen true, constrains content to readable line length matching document view settings.
classNamestring''Additional CSS classes applied to the root container.
childrenReact.ReactNodeundefinedView 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-2 inner container padding). SidebarActionHeader applies h-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: SidebarActionButton and CollapseAllButton render at w-7 h-7 rounded-md (28x28px) with 16px icon size and gap-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

PropTypeDefaultDescription
childrenReact.ReactNodeundefinedAction buttons, dropdowns, and controls rendered in the header.
borderBottombooleanfalseWhen true, renders a subtle bottom border separator (border-[var(--noether-border-base)]).
classNamestring''Additional CSS classes applied to the container.

SidebarActionButtonProps

PropTypeDefaultDescription
iconReact.ReactNodeundefinedPrimary icon element (rendered at 16px by convention).
isActivebooleanfalseWhen true, highlights the button with active card background styling.
disabledbooleanfalseDisables pointer events and dims opacity to 35%.
titlestringundefinedTooltip title shown on hover and used for accessibility labels.
onClick(e: React.MouseEvent) => voidundefinedClick event handler callback.
classNamestring''Additional CSS classes.

CollapseAllButtonProps

PropTypeDefaultDescription
isCollapsedboolean-Whether the target items are currently all collapsed.
onToggle() => void-Toggle handler callback.
disabledbooleanfalseDims button when no collapsible items exist.
collapsedTitlestring'Expand all'Tooltip when items are collapsed (clicking will expand).
expandedTitlestring'Collapse all'Tooltip when items are expanded (clicking will collapse).
sizenumber16Icon glyph size in pixels.

SortDropdownProps<T>

PropTypeDefaultDescription
valueT-Currently selected sort option ID.
onChange(value: T) => void-Sort change callback.
optionsSortOption<T>[]-Array of sort option descriptors ({ id, label, section? }).
disabledbooleanfalseDims button when items list is empty.
titlestring'Change sort order'Tooltip label.

Search wiki and portfolio

type to search across all entries.