tessera_ui_basic_components/lib.rs
1//! Basic components for the Tessera UI framework.
2//!
3//! # Usage
4//!
5//! First, you need to register the pipelines provided by this crate.
6//!
7//! ```no_run
8//! use tessera_ui::renderer::Renderer;
9//! use tessera_ui_basic_components::pipelines::register_pipelines;
10//!
11//! Renderer::run(
12//! // ...
13//! # || {}, // Placeholder for root component
14//! |app| {
15//! tessera_ui_basic_components::pipelines::register_pipelines(app);
16//! }
17//! );
18//! ```
19//!
20//! Then you can use the components in your UI.
21//!
22//! # Example
23//!
24//! ```
25//! use std::sync::Arc;
26//! use parking_lot::RwLock;
27//!
28//! use tessera_ui::Dp;
29//! use tessera_ui_basic_components::{
30//! button::{button, ButtonArgs},
31//! text::text,
32//! text_editor::{text_editor, TextEditorArgs, TextEditorState},
33//! RippleState,
34//! };
35//!
36//! // Button example
37//! let ripple_state = RippleState::new();
38//! button(
39//! ButtonArgs {
40//! on_click: Some(Arc::new(|| { /* Handle click */ })),
41//! ..Default::default()
42//! },
43//! ripple_state.clone(),
44//! || text("Click me".to_string()),
45//! );
46//!
47//! // Text editor example
48//! let editor_state = TextEditorState::new(Dp(16.0), None);
49//! text_editor(TextEditorArgs::default(), editor_state.clone());
50//! ```
51#![deny(missing_docs, clippy::unwrap_used)]
52
53mod animation;
54mod padding_utils;
55mod selection_highlight_rect;
56
57pub mod alignment;
58pub mod bottom_sheet;
59pub mod boxed;
60pub mod button;
61pub mod button_groups;
62pub mod checkbox;
63mod checkmark;
64pub mod column;
65pub mod dialog;
66pub mod fluid_glass;
67pub mod glass_button;
68pub mod glass_progress;
69pub mod glass_slider;
70pub mod glass_switch;
71pub mod icon;
72pub mod icon_button;
73pub mod image;
74pub mod image_vector;
75pub mod lazy_list;
76pub mod material_color;
77pub mod material_icons;
78pub use pipelines::shape::command::{RippleProps, ShadowProps};
79pub use ripple_state::RippleState;
80pub mod menus;
81pub mod navigation_bar;
82pub mod pipelines;
83pub mod pos_misc;
84pub mod progress;
85pub mod radio_button;
86pub mod ripple_state;
87pub mod row;
88pub mod scrollable;
89pub mod shape_def;
90pub mod side_bar;
91pub mod slider;
92pub mod spacer;
93pub mod surface;
94pub mod switch;
95pub mod tabs;
96pub mod text;
97mod text_edit_core;
98pub mod text_editor;