Skip to content

Home

CascadeUI -- A Redux-Inspired Framework for Discord.py

A state management and UI framework for discord.py bots. CascadeUI replaces ad-hoc view logic with a centralized state store, dispatched actions, and reducer-driven updates -- the same architecture that powers large-scale web frontends, adapted for Discord's component system.

Why CascadeUI?

  • Predictable state flow -- every UI change follows the same path: action → reducer → subscriber → refresh. No scattered mutation, no mystery state.
  • V2-first components -- built for Discord's modern component system (LayoutView, Container, Section, TextDisplay) with full V1 support for embed-based views.
  • Pre-built patterns -- forms, wizards, tabs, and pagination ship ready to use with customizable buttons, hooks, and per-step validation.
  • Persistence that survives restarts -- built-in SQLite backend (via aiosqlite), an in-memory backend for tests, and a capability-flag Protocol for custom backends. Debounced writes, opt-in per-slot persistence, and views that re-attach to their Discord messages after a bot restart.

Data Flow

User clicks button
  Interaction dispatched
  Callback runs → dispatch(action)
  Middleware pipeline (logging, persistence, undo)
  Reducer transforms state
  Subscribers notified (filtered by action + selector)
  on_state_changed() → refresh() → UI updated

Requirements

  • Python 3.10+
  • discord.py 2.7+

Get Started

Support