Skip to main content

Crate ratatui_reactive

Crate ratatui_reactive 

Source
Expand description

§ratatui-reactive   Action Badge Version Badge License Badge Docs Badge

A minimalistic framework for building TUI applications using fine-grained reactivity.

§Usage

Examples of how to use the library can be found here.

§Why?

I built this library around my personal preference for creating UIs with reactive systems. ratatui-reactive is designed around a reactive graph, rather than the message-driven architectures (like Elm) commonly used in many Rust UI libraries.

§Contributing

If you find any errors in ratatui-reactive or just want to add a new feature feel free to submit a PR.

§Credits

Macros§

impl_into_maybe_dyn
A macro that makes it easy to write implementations for Into<MaybeDyn<T>>.
impl_into_maybe_dyn_with_convert
Create From<U> implementations for MaybeDyn<T> for a list of types.

Structs§

FocusManager
Focusable
NodeHandle
A handle to a reactive node (signal, memo, effect) that lets you run further tasks in it or manually dispose it.
ReactiveApp
ReadSignal
A read-only reactive value.
RootHandle
A handle to a root. This lets you reinitialize or dispose the root for resource cleanup.
Route
Router
Runtime
Signal
A reactive value that can be read and written to.

Enums§

MaybeDyn
Represents a value that can be either static or dynamic.

Traits§

Component
Render
Trackable
A trait that is implemented for reactive data that can be tracked, such as Signal.

Functions§

batch
Batch updates from related signals together and only run memos and effects at the end of the scope.
create_child_scope
Create a child scope.
create_effect
Creates an effect on signals used inside the effect closure.
create_effect_initial
Creates an effect that runs a different code path on the first run.
create_interval
create_memo
Creates a memoized computation from some signals.
create_progress
create_reducer
An alternative to create_signal that uses a reducer to get the next value.
create_resource
create_root
Creates a new reactive root with a top-level reactive node. The returned RootHandle can be used to dispose the root.
create_selector
Creates a memoized value from some signals.
create_selector_with
Creates a memoized value from some signals. Unlike create_memo, this function will not notify dependents of a change if the output is the same.
create_signal
Create a new Signal.
create_timeout
delayed_signal
init_mock_events
map_indexed
Function that maps a Vec to another Vec via a map function.
map_keyed
Function that maps a Vec to another Vec via a map function and a key.
on
A helper function for making dependencies explicit. This will create a closure that tracks those and only those dependencies that are passed to it.
on_cleanup
Adds a callback that is called when the scope is destroyed.
on_event
on_key
on_key_press
on_mouse
on_resize
provide_context
Provide a context value in this scope.
provide_context_in_new_scope
Provide a context value in a new scope.
provide_focus_manager
provide_router
run
run_with_terminal
sleep
spawn
spawn_local
try_use_context
Tries to get a context value of the given type. If no context is found, returns None.
untrack
Run the passed closure inside an untracked dependency scope.
use_context
Get a context with the given type. If no context is found, this panics.
use_context_or_else
Try to get a context with the given type. If no context is found, returns the value of the function and sets the value of the context in the current scope.
use_current_scope
Get a handle to the current reactive scope.
use_global_scope
Get a handle to the root reactive scope.
use_scope_depth
Gets how deep the current scope is from the root/global scope. The value for the global scope itself is always 0.