Expand description
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 = RippleState::new();
button(
ButtonArgs {
on_click: Some(Arc::new(|| { /* Handle click */ })),
..Default::default()
},
ripple_state.clone(),
|| text("Click me".to_string()),
);
// Text editor example
let editor_state = 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_
sheet - A component that displays content sliding up from the bottom of the screen.
- boxed
- A container for stacking and aligning multiple children.
- button
- An interactive button component.
- button_
groups - Material 3-style segmented buttons with single or multiple selection.
- checkbox
- A customizable, animated checkbox component.
- column
- A vertical layout component.
- dialog
- Modal dialog provider — show modal content above the main app UI.
- fluid_
glass - A component for creating a frosted/distorted glass visual effect.
- glass_
button - An interactive button with a glassmorphic background.
- glass_
progress - A progress bar with a glassmorphic visual style.
- glass_
slider - A slider component with a glassmorphic visual style.
- glass_
switch - A switch (toggle) component with a glassmorphic visual style.
- icon
- A component for rendering raster or vector icons.
- icon_
button - An interactive button that displays an icon.
- image
- A component for rendering raster images.
- image_
vector - Vector image component built on top of SVG parsing and tessellation.
- lazy_
list - Virtualized list components for displaying long scrolling feeds.
- material_
color - Material Design color utilities for HCT and dynamic scheme generation.
- material_
icons - Material Design icon content helpers.
- menus
- Material Design 3 menus for contextual action lists.
- navigation_
bar - Material Design 3 navigation bar for primary app destinations.
- pipelines
- Render and compute pipelines backing the basic components.
- 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
- A linear progress bar component.
- radio_
button - Material Design 3 radio button with animated selection feedback.
- ripple_
state - Ripple state — manage ripple animation and hover state for interactive components.
- row
- A horizontal layout component.
- scrollable
- A container that allows its content to be scrolled.
- shape_
def - Defines the
Shapeenum and its variants, used for describing the geometric form of UI components. - side_
bar - A component that displays a side bar sliding in from the left.
- slider
- An interactive slider component for selecting a value in a range.
- spacer
- An invisible component for creating empty space in a layout.
- surface
- A flexible container component with styling and interaction options.
- switch
- An interactive toggle switch component.
- tabs
- A component for creating a tab-based layout.
- text
- A component for rendering single-style text.
- text_
editor - A multi-line text editor component.
Structs§
- Ripple
Props - Properties for ripple effect animation
- Shadow
Props - Properties for shadow, used in BasicDrawable variants