API Reference

This is the reference for Charming’s current public API. Prefer these APIs in app code. Classes under Charming::Internal are runtime internals and are documented mainly for testing.

The reference is organized to follow the shape of an app — from the application object down to the pieces it renders:

  • Application & Configuration — the Charming::Application class, environment, and the Charming.run entrypoint.
  • Routing — the routes DSL, resolution rules, and route objects.
  • Controllers & Responses — key bindings, actions, hooks, state, and the response objects actions return.
  • Views & Templates — class-based views, view helpers, and the ERB template fallback.
  • Components API — the component base class, event conventions, and the bundled component catalog.
  • UI & Themes — the Style builder, layout helpers, color capability, and theme tokens.
  • Events, Tasks & Media — event classes, async task executors, animation physics, and audio playback.
  • Testing & CLI — test backends, TestHelper, RSpec matchers, and charming commands.

Where do I look for…?

I want to… Go to
Configure my app, register themes, persist the session Application & Configuration
Map a path like /users/:id to a controller Routing
Handle a key press, run a background task, navigate, or quit Controllers & Responses
Keep data across events with typed attributes Controllers & Responses (ApplicationState)
Render output with text, box, row, or ERB templates Views & Templates
Use a bundled widget (list, table, form, modal, spinner…) Components API
Style text, draw borders, join blocks, use theme colors UI & Themes
See what fields an event carries, animate, or play sound Events, Tasks & Media
Test a controller or use the CLI generators Testing & CLI

For tutorial-style explanations, see Getting Started. For topic guides, see the docs index.


Table of contents


This site uses Just the Docs, a documentation theme for Jekyll.