Phials developer documentation
User guide
AI Notice: Most documentation right now was auto-generated by an LLM. Handwritten documentation will be implemented over time on the road to 1.0

ModuleProvider

Module provider - provides a UI module that can be placed in any panel

Modules are self-contained UI components like Navigator, File Preview, or Terminal that can be arranged in tabs or splits within panels.

Signature

interface ModuleProvider {
    type: "module";
    id: string;
    name: string;
    icon: string;
    allowedPositions?: ModulePosition[];
    defaultPosition?: ModulePosition;
    component: import("svelte").Component<ModuleProviderProps>;
    allowMultiple?: boolean;
    requiresRemount?: boolean;
    getDefaultState?: () => unknown;
    shortcut?: ItemShortcutConfig;
    getTabTitle?: (state?: unknown) => string;
    getTabIcon?: (state?: unknown) => string;
}

Members

NameTypeRequiredDescription
type"module"yes
idstringyesUnique module identifier (e.g., ‘phials.module.navigator’)
namestringyesHuman-readable name for display
iconstringyesIcon for tabs and headers
allowedPositionsModulePosition[]noPositions where this module can be placed (default: all panels, not center)
defaultPositionModulePositionnoDefault position for new instances
componentimport("svelte").Component<ModuleProviderProps>yesThe module component
allowMultiplebooleannoWhether multiple instances of this module are allowed (default: false)
requiresRemountbooleannoIf true, the component is fully remounted when switching between instances (needed for lifecycle-heavy modules like Terminal). Default: false.
getDefaultState() => unknownnoDefault state for new module instances
shortcutItemShortcutConfignoKeyboard shortcut to toggle/focus this module
getTabTitle(state?: unknown) => stringnoDynamic tab title when rendered in center (falls back to name)
getTabIcon(state?: unknown) => stringnoDynamic tab icon when rendered in center (falls back to icon)