Skip to content

Overview

This section covers the main pieces of xnano, grouped the same way as the site navigation.

For a full application built step by step, see Getting Started.

v1.2

These pages describe v1.2.xx and higher. Earlier releases used a different surface (xnano.beta and related hosts).

Map

Same groups as the sidebar.

Hosts

Page Topic
Terminal Run an app in the terminal
Web Run the same app in a browser

Layout & Styling

Page Topic
Grids Structure the screen with BaseGrid
Fields Put content and state in slots
State App state=, Field(state=True), groups, and sync
Components Tables, inputs, charts, and other widgets
Styling Colors, borders, and Tailwind classes

Live Behavior & Events

Page Topic
Effects Animate field areas
Events & Hooks React to keys, clicks, ticks, and more
Context Values available inside a hook
Actions Name a trigger once and reuse it
Device & Cursor Window title, clipboard, and caret

Additional Features

Useful, but optional. Pages here that are still unstable say Experimental at the top.

Page Topic
Markdown Page through a Markdown file
Requests Handle HTTP requests on a grid
CLI Commands Build small command-line tools

Layers

Application code is grids, fields, hooks, and components. Hosts (Terminal, Web) run that code. Paint and the session loop live in xnano-core.

One frame without a session

render paints values once and writes them out. It does not start an event loop.

Interactive

This code block runs in the browser via Pyodide.

Try editing the code!
  • Change foreground on the Text.
  • Change modifiers (e.g. ["bold", "italic"]).

Editor (session: default)Run
from xnano import render
from xnano.components.text import Text

render(Text("Hello from xnano", foreground="pink", modifiers=["bold"]))
OutputClear

For a live terminal session, use Terminal. For the same grid in a browser, use Web.

Public surface checklist

Root exports and where this section covers them:

Export / module Concept page
Terminal, render, Runtime, Frame Terminal
Web Web
BaseGrid, GridSettings Grids
Field Fields / State
Style (+ xnano.colors) Styling
Component, xnano.components Components
on_*, hooks, events Events & Hooks
Context (+ xnano.state.State) Context
Action Actions
xnano.device, xnano.cursor Device & Cursor
xnano.markdown Markdown
xnano.effects Effects
requests Requests
Command, cli CLI Commands
xnano.server Web / Requests
xnano.core Runtime, Frame, exceptions — via hosts and API reference

Lower-level packages (utils, paint content helpers) stay in the API reference.

API

render() · Terminal · Web · BaseGrid