Skip to content
Back to skills

SKILL.md — AI Skill Definition

ASecurity

Use when building or styling a Rust terminal UI (TUI) application with ratatui and you need to apply a consistent color theme, switch between themes at runtime, or use semantic status colors (error, warning, success). Trigger terms: ratatui theme, TUI color scheme, Dracula terminal, Nord ratatui, Catppuccin TUI, Tokyo Night terminal, dark theme rust, ratatui palette, theme cycling, serde theme preference.

  • 38 stars
  • 0 votes
  • 0 copies
  • 3 views
  • Added June 5, 2026
designrustgogit

Works with

  • terminal
  • cli

Security analysis

A100/100

Pro scans all 11 files and shows the line behind each finding

Scanned November 17, 2026

npx -y skills add ricardodantas/ratatui-themes --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of SKILL.md — AI Skill Definition?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for SKILL.md — AI Skill Definition
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/ricardodantas-skill-md-ai-skill-definition/badge)](https://www.skillsdirectory.com/skills/ricardodantas-skill-md-ai-skill-definition)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: ratatui-themes
description: >
  Use when building or styling a Rust terminal UI (TUI) application with ratatui
  and you need to apply a consistent color theme, switch between themes at runtime,
  or use semantic status colors (error, warning, success). Trigger terms: ratatui
  theme, TUI color scheme, Dracula terminal, Nord ratatui, Catppuccin TUI,
  Tokyo Night terminal, dark theme rust, ratatui palette, theme cycling, serde
  theme preference.
---

# ratatui-themes Skill

A Rust library providing 17 pre-defined color themes for terminal UI applications
built with `ratatui`. Includes Dracula, Nord, Catppuccin, Tokyo Night, Gruvbox,
and more — with semantic status colors and optional serde support for persistence.

## When to Use

- You are building a `ratatui`-based TUI and want a polished color scheme out of the box
- You need semantic colors (`error`, `warning`, `success`, `info`) for status indicators
- You want users to cycle through themes at runtime
- You want to persist the user's theme choice across sessions with serde

## Quick Start

### 1. Add the dependency

```toml
# Cargo.toml
[dependencies]
ratatui-themes = "0.4"
```

### 2. Apply a theme to a widget

```rust
use ratatui_themes::{Theme, ThemeName};
use ratatui::style::Style;

let theme = Theme::new(ThemeName::Dracula);
let palette = theme.palette();

let style = Style::default()
    .fg(palette.fg)
    .bg(palette.bg);

// Use semantic colors for status indicators
let error_style = Style::default().fg(palette.error);
let success_style = Style::default().fg(palette.success);
```

### 3. Cycle through themes at runtime

```rust
use ratatui_themes::ThemeName;

let mut current = ThemeName::Dracula;

// Move to next/previous theme (wraps around)
current = current.next();
current = current.prev();
```

### 4. Persist theme preference with serde

The `serde` feature is enabled by default; add `serde` itself to derive on your config type:

```toml
# Cargo.toml
[dependencies]
ratatui-themes = "0.4"
serde = { version = "1", features = ["derive"] }
```

```rust
use ratatui_themes::ThemeName;
use serde::{Deserialize, Serialize};

#[derive(Serialize, Deserialize)]
struct AppConfig {
    theme: ThemeName,
}

// Save / load via serde_json, toml, etc. Names are kebab-case: "nord", "tokyo-night"
let config = AppConfig { theme: ThemeName::Nord };
let json = serde_json::to_string(&config)?;
```

## Available Themes

| Category | Themes |
|----------|--------|
| Dark | Dracula, OneDarkPro, Nord, CatppuccinMocha, GruvboxDark, TokyoNight, SolarizedDark, MonokaiPro, RosePine, Kanagawa, Everforest, Cyberpunk, MidnightCommander, Msx |
| Light | CatppuccinLatte, GruvboxLight, SolarizedLight |

## Palette Reference

Each theme exposes a `ThemePalette` (`theme.palette()`) with these fields:

| Field | Purpose |
|-------|---------|
| `bg`, `fg` | Base background and foreground |
| `muted` | Subdued text / secondary information |
| `accent`, `secondary` | Highlight / call-to-action colors |
| `selection` | Selection / highlight background |
| `error`, `warning`, `success`, `info` | Semantic status colors |

## Links

- **Crate**: https://crates.io/crates/ratatui-themes
- **Docs**: https://docs.rs/ratatui-themes
- **Source**: https://github.com/ricardodantas/ratatui-themes

Files in this skill

  • AGENTS.md2.5 KB
  • CHANGELOG.md883 B
  • CONTRIBUTING.md2.8 KB
  • Cargo.lock37.7 KB
  • Cargo.toml1 KB
  • SKILL.md1.6 KB
  • examples/gallery.rs1.5 KB
  • llms.txt1.3 KB
  • src/lib.rs4.3 KB
  • src/palette.rs5.3 KB
  • src/theme.rs30.1 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in design →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.