Skip to main content

icon

Function icon 

Source
pub fn icon() -> IconBuilder
Expand description

§icon

Renders an icon with consistent sizing and optional tinting for vectors.

§Usage

Display a vector or raster symbol with uniform size, typically in controls and compact labels.

§Parameters

  • content - optional painter payload for vector or raster imagery.
  • size - optional preferred square size.
  • width / height - optional explicit layout dimensions.
  • tint - optional tint override for vector icons.
  • tint_mode - vector tint blending mode, defaulting to solid recoloring.
  • rotation - clockwise degrees, inheriting control motion when omitted.

§Examples

use tessera_components::{icon::icon, material_icons::filled};
use tessera_ui::Color;

icon()
    .painter(filled::STAR_SVG)
    .size(tessera_ui::Dp(20.0))
    .tint(Color::new(0.2, 0.5, 0.8, 1.0));