Skip to content

Theme Plugins

Theme plugins are pure data — they define a color palette and optional component-level overrides. No runtime logic is required.

import type { ThemePlugin } from '@tokentop/plugin-sdk';
const myTheme: ThemePlugin = {
id: 'my-theme',
type: 'theme',
name: 'My Theme',
version: '1.0.0',
apiVersion: 2,
permissions: {},
colorScheme: 'dark',
family: 'custom',
colors: {
background: '#1a1b26',
foreground: '#24283b',
text: '#c0caf5',
textMuted: '#737aa2',
textSubtle: '#565f89',
primary: '#7aa2f7',
secondary: '#bb9af7',
accent: '#7dcfff',
success: '#9ece6a',
warning: '#e0af68',
error: '#f7768e',
info: '#7aa2f7',
border: '#414868',
borderMuted: '#292e42',
selection: '#33467c',
highlight: '#2f3549',
gaugeBackground: '#24283b',
gaugeFill: '#7aa2f7',
gaugeWarning: '#e0af68',
gaugeDanger: '#f7768e',
},
};
export default myTheme;

Set colorScheme to 'dark' or 'light' to indicate whether the theme is designed for dark or light terminal backgrounds. This helps tokentop apply appropriate contrast adjustments.

Optionally override styling for specific UI components:

components: {
header: {
background: '#16161e',
foreground: '#c0caf5',
titleColor: '#7aa2f7',
titleAccentColor: '#bb9af7',
},
statusBar: {
background: '#1f2335',
foreground: '#737aa2',
},
commandPalette: {
background: '#1a1b26',
border: '#414868',
},
gauge: {
height: 1,
borderRadius: 0,
},
}

At minimum, a theme must define all fields in the colors object. All color properties are flat (not nested) — see the color reference table below. The component overrides are optional — tokentop derives sensible defaults from the base colors.

ColorPurpose
backgroundMain background color
foregroundSecondary background (cards, panels)
textPrimary text color
textMutedSecondary text (labels, descriptions)
textSubtleTertiary text (hints, inactive items)
primaryPrimary accent (selected items, links)
secondarySecondary accent (highlights, badges)
accentTertiary accent (special indicators)
successPositive indicators (under budget, healthy)
warningCaution indicators (approaching limits)
errorAlert indicators (over budget, errors)
infoInformational indicators
borderPrimary borders and dividers
borderMutedSubtle borders and separators
selectionSelected/highlighted rows
highlightHover or focus indicators
gaugeBackgroundGauge track (unfilled portion)
gaugeFillGauge fill at normal usage
gaugeWarningGauge fill approaching limits
gaugeDangerGauge fill at critical usage

Load your theme locally during development:

Terminal window
ttop --plugin ./my-theme

Use demo mode to see how your theme looks with data:

Terminal window
ttop demo --plugin ./my-theme