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//! ```no_run
11//! use tessera_ui::renderer::Renderer;
12//! use tessera_ui_basic_components::pipelines::register_pipelines;
13//!
14//! Renderer::run(
15//! // ...
16//! # || {}, // Placeholder for root component
17//! |app| {
18//! tessera_ui_basic_components::pipelines::register_pipelines(app);
19//! }
20//! );
21//! ```
22//!
23//! Then you can use the components in your UI.
24//!
25//! # Example
26//!
27//! ```
28//! use std::sync::Arc;
29//! use parking_lot::RwLock;
30//!
31//! use tessera_ui::Dp;
32//! use tessera_ui_basic_components::{
33//! button::{button, ButtonArgs},
34//! text::text,
35//! text_editor::{text_editor, TextEditorArgs, TextEditorState},
36//! RippleState,
37//! };
38//!
39//! // Button example
40//! let ripple_state = Arc::new(RippleState::new());
41//! button(
42//! ButtonArgs {
43//! on_click: Some(Arc::new(|| { /* Handle click */ })),
44//! ..Default::default()
45//! },
46//! ripple_state,
47//! || text("Click me".to_string()),
48//! );
49//!
50//! // Text editor example
51//! let editor_state = Arc::new(RwLock::new(TextEditorState::new(Dp(16.0), None)));
52//! text_editor(TextEditorArgs::default(), editor_state.clone());
53//! ```
54
55mod animation;
56mod padding_utils;
57mod selection_highlight_rect;
58
59pub mod alignment;
60pub mod bottom_sheet;
61pub mod boxed;
62pub mod button;
63pub mod checkbox;
64mod checkmark;
65pub mod column;
66pub mod dialog;
67pub mod fluid_glass;
68pub mod glass_button;
69pub mod glass_progress;
70pub mod glass_slider;
71pub mod glass_switch;
72pub mod image;
73pub mod pipelines;
74pub mod pos_misc;
75pub mod progress;
76pub mod ripple_state;
77pub use ripple_state::RippleState;
78pub mod bottom_nav_bar;
79pub mod row;
80pub mod scrollable;
81pub mod shape_def;
82pub mod side_bar;
83pub mod slider;
84pub mod spacer;
85pub mod surface;
86pub mod switch;
87pub mod tabs;
88pub mod text;
89mod text_edit_core;
90pub mod text_editor;