Skip to main content

Crate tessera_components

Crate tessera_components 

Source
Expand description

Basic components for the Tessera UI framework.

Built-in labels follow the language registered with the application entry.

§Usage

First, add the package (recommended) or render module provided by this crate at application entry.

use tessera_components::theme::{MaterialTheme, material_theme};

#[tessera_ui::tessera]
fn app() {
    material_theme()
        .theme(|| MaterialTheme::default())
        .child(|| {
            // Your app code here
        });
}

use tessera_ui::EntryPoint;

#[tessera_ui::entry]
pub fn run() -> EntryPoint {
    EntryPoint::new(app).package(tessera_components::ComponentsPackage)
}

fn main() {
    let _ = run().run_desktop();
}

Then you can use the components in your UI.

§Example

use tessera_components::{button::button, text::text, text_input::text_input};

// Button example
button().filled().on_click(|| {}).child(|| {
    text("Click me");
});

// Text editor example
text_input();

Re-exports§

pub use ripple_state::RippleState;

Modules§

alignment
Alignment types shared by foundational layout APIs.
app_bar
Top app bars for app-level navigation and actions.
badge
Material Design badge primitives.
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
Material-styled button components.
button_groups
Material 3 button groups for related actions.
card
Material Design card primitives.
carousel
Adaptive carousels with smoothly masked, full-size content.
checkbox
A customizable, animated checkbox component.
chip
Material Design chip components.
column
A vertical layout component.
date_picker
Date picker components for selecting dates and inclusive ranges.
dialog
Modal dialog provider — show modal content above the main app UI.
divider
Material Design divider primitives.
extended_floating_action_button
Extended floating action buttons with animated labels.
floating_action_button
Floating action button component.
floating_action_button_menu
Floating action menus with staggered action expansion.
flow_column
A flowing vertical layout component.
flow_row
A flowing horizontal layout component.
fluid_glass
A component for creating a frosted liquid lens glass visual effect.
fluid_switch
Fluid glass switch - toggle state with a surface track and glass lens.
fonts
Fonts loaded on demand when text uses their family or Unicode ranges.
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
Icon component for rendering vector or raster imagery.
icon_button
Icon actions with Expressive sizes, widths, and selection states.
image
Raster image component and decoding utilities.
image_vector
Scalable vector images.
interaction_state
Shared interaction state for hover/press/focus tracking.
lazy_grid
Virtualized grid components for efficient, scrollable tile layouts.
lazy_list
Virtualized list components for displaying long scrolling feeds.
lazy_staggered_grid
Virtualized staggered grid components for masonry layouts.
list_item
Material Design list item component.
loading_indicator
Expressive loading indicators with morphing shapes.
material_icons
Material Design icon assets.
menus
Material Design 3 menus for contextual action lists.
modifier
Modifier extensions for basic components.
navigation_bar
Material Design 3 navigation bar for primary app destinations.
navigation_drawer
Navigation drawer surfaces and selectable destinations.
navigation_rail
Material Design 3 navigation rail with collapsed and expanded layouts.
pager
Pager container for swipeable pages.
painter
Unified painter content for vector and raster imagery.
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
Material progress indicators.
pull_refresh
Pull-to-refresh container and indicator for scrollable content.
radio_button
Material Design 3 radio button with animated selection feedback.
res
Generated asset bindings for tessera-components.
ripple_state
Ripple state — manage ripple animation and interaction state layers.
row
A horizontal layout component.
scaffold
Scaffold layout for persistent bars and app content.
scrollable
Scrollable viewports driven by a ScrollableController.
search
Search bar component - capture queries with optional suggestion content.
segmented_buttons
Material Design segmented buttons for compact selections.
shadow
Shadow layer definitions for Material surfaces.
shape_def
Shape definitions shared by foundational visual APIs.
side_sheet
Side sheet provider - slide supporting content in from the screen edge.
slider
An interactive slider component for selecting a value in a range.
snackbar
Material Design snackbars for transient feedback messages.
spacer
An invisible component for creating empty space in a layout.
split_buttons
Material Design split buttons for primary and secondary actions.
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
Single-style text rendering.
text_field
Material text fields for filled, outlined, and secure input.
text_input
Editable text input with Material outlined styling.
text_table
Text tables with content-sized columns and merged cells.
theme
Material theme primitives for color, typography, and shape.
time_picker
Time picker components for selecting a clock time.
toolbar
Floating toolbars for frequently used page actions.
tooltip
Anchored plain and rich contextual tooltips.
wavy_progress
Expressive progress indicators with moving waves.

Structs§

ComponentsPackage
Package that registers the components module and required platform services.
RippleProps
Properties for ripple effect animation