Overview
The Ghostty Config editor is built with Svelte components organized into setting controls, UI elements, and specialized editors.Setting Components
These components provide the UI for configuring individual settings.Color
Color
Location:
Features:
src/lib/components/settings/Color.svelteA color input component with an interactive color picker popout.Props
| Prop | Type | Default | Description |
|---|---|---|---|
value | HexColor (bindable) | - | The current color value |
size | number | 20 | Size of the color display in pixels |
label | string | "" | Optional label to display on the color |
defaultValue | HexColor | - | Default value for reset functionality |
Usage
- Click to open ColorPicker modal
- Right-click to reset to default value
- Dynamic border color based on luminosity
- Escape key closes the picker
ColorPicker
ColorPicker
Location:
Features:
src/lib/components/ColorPicker.svelteInteractive HSV color picker with hex/RGB display.Props
| Prop | Type | Default | Description |
|---|---|---|---|
value | HexColor | "" (bindable) | - | The current color value |
defaultValue | HexColor | "#408080" | Default color when value is empty |
Implementation Details
- 2D saturation/brightness gradient selector
- Horizontal hue slider
- Live hex input with validation
- RGB value display
- Empty state visualization (red X)
Palette
Palette
KeybindEditor
KeybindEditor
Location:
Features:
src/lib/components/settings/KeybindEditor.svelteAdvanced keybind configuration interface.Props
| Prop | Type | Description |
|---|---|---|
value | string | The keybind string to edit |
onsave | (value: string) => void | Callback when user saves |
oncancel | () => void | Callback when user cancels |
Keybind Structure
- Prefix selection (global, all, unconsumed, performable)
- Multi-step sequence editor (up to 4 steps)
- Action dropdown with argument validation
- Special handling for
resize_splitaction - Live preview with error validation
- Key name autocomplete from 177+ valid keys
Example Output
Dropdown
Dropdown
Number
Number
Text
Text
Location:
src/lib/components/settings/Text.svelteText input for string settings.Props
| Prop | Type | Default | Description |
|---|---|---|---|
value | string (bindable) | - | Text value |
placeholder | string | "" | Placeholder text |
blank | boolean | false | Transparent background |
align | "left" | "right" | "right" | Text alignment |
change | (e: Event) => void | - | Change handler |
Switch
Switch
Location:
src/lib/components/settings/Switch.svelteAnimated toggle switch for boolean values.Props
| Prop | Type | Default | Description |
|---|---|---|---|
checked | boolean (bindable) | false | Switch state |
disabled | boolean | false | Disable interaction |
onchange | (checked: boolean) => void | - | Change callback |
Styling
Uses CSS custom properties:--switch-body-color--switch-checked-color--switch-active-body-color--switch-active-checked-color
Checkbox
Checkbox
Location:
Features:
src/lib/components/settings/Checkbox.svelteCheckbox with animated checkmark.Props
| Prop | Type | Default | Description |
|---|---|---|---|
checked | boolean (bindable) | false | Checked state |
disabled | boolean | false | Disable interaction |
onchange | (checked: boolean) => void | - | Change callback |
- SVG checkmark with stroke-dasharray animation
- Blue gradient when checked
- Grayscale when disabled
Layout Components
Group
Group
Location:
src/lib/components/settings/Group.svelteContainer for related settings with optional title.Props
| Prop | Type | Default | Description |
|---|---|---|---|
title | string | "" | Group heading |
note | string | "" | Subtitle description |
flex | string | number | "" | CSS flex value |
borderless | boolean | false | Remove background/border |
children | Snippet | - | Content slot |
Usage
Specialized Components
Theme
Theme
Location:
When changed, fetches the theme file and updates all color settings (background, foreground, palette, etc.).
src/lib/components/settings/Theme.svelteSpecial dropdown that loads color schemes.Props
| Prop | Type | Description |
|---|---|---|
value | string (bindable) | Theme name |
options | Array<string | {name: string, value: string}> | Available themes |
Implementation
UI Components
General-purpose UI components used throughout the application.Admonition
Admonition
Tab
Tab
Tooltip
Tooltip
Location:
src/lib/components/Tooltip.svelteTooltip component with positioning logic.Props
| Prop | Type | Description |
|---|---|---|
text | string | Tooltip content |
children | Snippet | Element to attach tooltip to |
Features
- Hover-triggered display
- Auto-positioning to avoid viewport edges
- Uses
tooltipaction fromsrc/lib/attachments/tooltip.ts
History
History
User
User
Preview Components
These components fromsrc/lib/views/ provide live previews of configuration changes.
CursorPreview
CursorPreview
Location:
src/lib/views/CursorPreview.svelteAnimated cursor preview showing the current cursor style and color.Features
- Displays animated cursor based on
config.cursorStyle - Shows cursor color from
config.cursorColor - Supports all cursor styles:
block,bar,underline - Includes blinking animation
- Displays sample text for context
Usage
Referenced in the Features documentation and visible in the Colors settings panel.FontPreview
FontPreview
Location:
src/lib/views/FontPreview.svelteInteractive font testing playground with sample terminal output.Features
- Live font family preview
- Font size adjustment
- Bold and italic style toggles
- Sample text with code, Unicode, and box-drawing characters
- Does not persist changes (for testing only)
Sample Content
PalettePreview
PalettePreview
Location:
src/lib/views/PalettePreview.svelteGrid visualization of the 256-color terminal palette.Features
- 8×32 color grid layout
- Displays all 256 palette colors
- Each cell shows its index number
- Updates in real-time as palette is modified
- Clickable cells to edit individual colors
BaseColorPreview
BaseColorPreview
Location:
src/lib/views/BaseColorPreview.sveltePreview component for base terminal colors.Features
- Shows background, foreground, and selection colors
- Displays sample selected text
- Updates reactively with color changes
- Demonstrates actual text rendering
AppIconPreview
AppIconPreview
Location:
src/lib/views/AppIconPreview.sveltemacOS app icon customization preview (macOS-specific feature).Props
| Prop | Type | Description |
|---|---|---|
config | Config | Configuration object with icon settings |
Features
- Previews custom app icons with different styles
- Shows icon ghost color effects
- Displays icon frame styles
- macOS-only functionality
- Real-time preview of icon appearance
Supported Icon Styles
- Default Ghostty icon
- Custom icon frames (floating, decorative, etc.)
- Ghost color overlays
Component Patterns
Bindable Props
All setting components use Svelte 5’s$bindable() rune:
Derived State
Many components use$derived for reactive computations: