Mental model
Ratatui Kit looks like declarative UI, but at runtime it is still a render loop inside a terminal. You do not need the full API up front. Start with this main line:
Four names will appear repeatedly:
Elementis the declaration rebuilt every frame.Componentis the runtime instance that persists.Hooksare attached to component instances and store state by call order.- Writing to
Statewakes the waker and lets the render loop enter the next frame.
This explains two rules:
- Hook call order must be stable. Do not put
use_state,use_effect, oruse_event_handlerinside conditional branches or loops. - UI changes should go through a channel that can wake the runtime, such as
State,AtomState,use_future, or terminal events.
How much to read now
Section titled “How much to read now”You do not need to master the reconciliation algorithm, layout dispatch, or internal poll_change yet. As you continue through the tutorials, add concepts in this order:
- For interaction, read the counter tutorial and the Hooks reference.
- For modals, inputs, or shortcuts, read the input isolation tutorial and the input layer reference.
- For multi-page applications, read the Router tutorial and the routing reference.
- When you need to fully understand why state is retained, read the component model.