Skip to content

Custom Themes

If the built-in themes don’t match your terminal setup, you can create a custom theme as a plugin.

Create a new directory for your theme:

Terminal window
mkdir my-tokentop-theme
cd my-tokentop-theme

Create an index.ts (or index.js) file with your theme definition:

import type { ThemePlugin } from '@tokentop/plugin-sdk';
const theme: ThemePlugin = {
id: 'my-custom-theme',
type: 'theme',
name: 'My Custom Theme',
version: '1.0.0',
apiVersion: 2,
permissions: {},
colorScheme: 'dark',
family: 'custom',
colors: {
background: '#1e1e2e',
foreground: '#313244',
text: '#cdd6f4',
textMuted: '#6c7086',
textSubtle: '#585b70',
primary: '#89b4fa',
secondary: '#cba6f7',
accent: '#94e2d5',
success: '#a6e3a1',
warning: '#f9e2af',
error: '#f38ba8',
info: '#89b4fa',
border: '#45475a',
borderMuted: '#313244',
selection: '#45475a',
highlight: '#313244',
gaugeBackground: '#313244',
gaugeFill: '#89b4fa',
gaugeWarning: '#f9e2af',
gaugeDanger: '#f38ba8',
},
};
export default theme;

Load your theme with the --plugin flag:

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

Combine with demo mode to see your theme with data:

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

Your theme must define all colors in the colors object. All properties are flat strings (not nested objects):

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

Once your theme looks good, consider publishing it to npm so others can use it too. Follow the tokentop-theme-<name> naming convention.