Expand description
Basic UI components library for Tessera.
Internal animation utilities are available via the private animation
module.
Basic components for the Tessera UI framework.
§Usage
First, you need to register the pipelines provided by this crate.
use tessera_ui::renderer::Renderer;
use tessera_ui_basic_components::pipelines::register_pipelines;
Renderer::run(
// ...
|app| {
tessera_ui_basic_components::pipelines::register_pipelines(app);
}
);
Then you can use the components in your UI.
§Example
use std::sync::Arc;
use parking_lot::RwLock;
use tessera_ui::Dp;
use tessera_ui_basic_components::{
button::{button, ButtonArgs},
text::text,
text_editor::{text_editor, TextEditorArgs, TextEditorState},
RippleState,
};
// Button example
let ripple_state = Arc::new(RippleState::new());
button(
ButtonArgs {
on_click: Some(Arc::new(|| { /* Handle click */ })),
..Default::default()
},
ripple_state,
|| text("Click me".to_string()),
);
// Text editor example
let editor_state = Arc::new(RwLock::new(TextEditorState::new(Dp(16.0), None)));
text_editor(TextEditorArgs::default(), editor_state.clone());
Re-exports§
pub use ripple_state::RippleState;
Modules§
- alignment
- Defines alignment options for layout components.
- bottom_
nav_ bar - A bottom navigation bar for switching between primary application screens.
- bottom_
sheet - A component that displays content sliding up from the bottom of the screen.
- boxed
- Provides the
Boxed
component for overlaying multiple child components in a single container. - button
- Provides a highly customizable and interactive button component for Tessera UI.
- checkbox
- A customizable, animated checkbox UI component for Tessera UI.
- column
- Provides a flexible vertical layout component for arranging child widgets in a single column.
- dialog
- A modal dialog component for displaying critical information or actions.
- fluid_
glass - Fluid glass effect module for Tessera UI Basic Components.
- glass_
button - Provides an interactive button component with a glassmorphic (glass-like) background and ripple effect.
- glass_
progress - Provides a glassmorphism-style progress bar component for visualizing task completion.
- glass_
slider - Provides a glassmorphism-style slider component for selecting a value in modern UI applications.
- glass_
switch - Glass Switch Component Module
- image
- This module provides the
image
component and related utilities for rendering images in Tessera UI. - pipelines
- pos_
misc - Convenience utilities for testing whether a cursor/point falls inside a component or a rectangle. Functions operate using Px units and simple inclusive comparisons on edges.
- progress
- This module provides a customizable linear progress bar component for visualizing task completion.
- ripple_
state - This module defines the
RippleState
struct, which manages the state for ripple animations in interactive UI components. - row
- Row Component
- scrollable
- Scrollable container component for Tessera UI.
- shape_
def - Defines the
Shape
enum and its variants, used for describing the geometric form of UI components. - side_
bar - A component that displays content sliding in from the left side of the screen.
- slider
- A reusable, interactive slider UI component for selecting a value within the range [0.0, 1.0].
- spacer
- Spacer component for Tessera UI.
- surface
- Provides a flexible, customizable surface container component for UI elements.
- switch
- Switch Component Module
- tabs
- A tabs component that provides a horizontal tab bar with animated indicator and paged content.
- text
- Text component module for Tessera UI.
- text_
editor - Multi-line text editor component for the Tessera UI framework.