tessera_ui_basic_components/lib.rs
1//! Basic UI components library for Tessera.
2//! Internal animation utilities are available via the private `animation` module.
3
4//! Basic components for the Tessera UI framework.
5//!
6//! # Usage
7//!
8//! First, you need to register the pipelines provided by this crate.
9//!
10//! ```rust,ignore
11//! use tessera_ui::renderer::WgpuApp;
12//! use tessera_ui_basic_components::pipelines::register_pipelines;
13//!
14//! fn setup(app: &mut WgpuApp) {
15//! register_pipelines(app);
16//! }
17//! ```
18//!
19//! Then you can use the components in your UI.
20//!
21//! # Example
22//!
23//! ```
24//! use std::sync::Arc;
25//! use parking_lot::RwLock;
26//!
27//! use tessera_ui::Dp;
28//! use tessera_ui_basic_components::{
29//! button::{button, ButtonArgs},
30//! text::text,
31//! text_editor::{text_editor, TextEditorArgs, TextEditorState},
32//! RippleState,
33//! };
34//!
35//! // Button example
36//! let ripple_state = Arc::new(RippleState::new());
37//! button(
38//! ButtonArgs {
39//! on_click: Arc::new(|| { /* Handle click */ }),
40//! ..Default::default()
41//! },
42//! ripple_state,
43//! || text("Click me".to_string()),
44//! );
45//!
46//! // Text editor example
47//! let editor_state = Arc::new(RwLock::new(TextEditorState::new(Dp(16.0), None)));
48//! text_editor(TextEditorArgs::default(), editor_state.clone());
49//! ```
50
51mod animation;
52
53pub mod alignment;
54pub mod boxed;
55pub mod button;
56pub mod checkbox;
57pub mod checkmark;
58pub mod column;
59pub mod dialog;
60pub mod fluid_glass;
61pub mod glass_button;
62pub mod glass_dialog;
63pub mod glass_progress;
64pub mod glass_slider;
65pub mod glass_switch;
66pub mod image;
67pub mod padding_utils;
68pub mod pipelines;
69pub mod pos_misc;
70pub mod progress;
71pub mod ripple_state;
72pub use ripple_state::RippleState;
73pub mod row;
74pub mod scrollable;
75pub mod selection_highlight_rect;
76pub mod shape_def;
77pub mod slider;
78pub mod spacer;
79pub mod surface;
80pub mod switch;
81pub mod text;
82pub mod text_edit_core;
83pub mod text_editor;