Widgets

Icon

Icon

Display a standalone icon.

Example

icon("home")

Common properties

  • icon
  • size
  • color

Usage

row(
  spacing: 8,
  children: [
    icon(Ruflet::MaterialIcons::ADD),
    text(value: "Create")
  ]
)

Notes

  • Ruflet accepts icon name strings like "add"
  • Ruflet also accepts Ruflet::MaterialIcons::*

Complete API

Helpers

  • icon(icon = ..., **props)

Accepted properties

  • align — Alignment of the control within its parent.
  • animate_align — Animates alignment changes.
  • animate_margin — Animates margin changes.
  • animate_offset — Animates offset changes.
  • animate_opacity — Animates opacity changes.
  • animate_position — Animates position changes.
  • animate_rotation — Animates rotation changes.
  • animate_scale — Animates scale changes.
  • animate_size — Animates size changes.
  • apply_text_scaling — Sets the apply text scaling property.
  • aspect_ratio — Width-to-height ratio to maintain.
  • badge — Badge drawn on the corner of the control.
  • blend_mode — Sets the blend mode property.
  • bottom — Bottom offset when positioned inside a stack.
  • col — Responsive column span (1-12) per breakpoint.
  • color — Foreground color.
  • data — Arbitrary value you can attach to the control and read back in handlers.
  • disabled — Disables interaction when true.
  • expand — Fills the available space along the parent's main axis when true.
  • expand_loose — Like expand, but only grows up to the child's natural size.
  • fill — Sets the fill property.
  • grade — Sets the grade property.
  • height — Fixed height in logical pixels.
  • icon — Icon name shown by the control.
  • key — Stable identity used to preserve state across rebuilds.
  • left — Left offset when positioned inside a stack.
  • margin — Outer spacing around the control.
  • offset — Translation offset applied to the control.
  • opacity — Opacity from 0.0 (transparent) to 1.0 (opaque).
  • optical_size — Sets the optical size property.
  • right — Right offset when positioned inside a stack.
  • rotate — Rotation applied to the control.
  • rtl — Renders right-to-left when true.
  • scale — Scale transform applied to the control.
  • semantics_label — Sets the semantics label property.
  • shadows — Sets the shadows property.
  • size — Sets the size property.
  • size_change_interval — Throttle interval for on_size_change, in ms.
  • tooltip — Text shown on hover/long-press.
  • top — Top offset when positioned inside a stack.
  • visible — Hides the control when false.
  • weight — Sets the weight property.
  • width — Fixed width in logical pixels.

Events

  • on_animation_end — Fired when an animation completes.
  • on_size_change — Fired when the control's size changes.

Wire reference

  • Family: shared
  • Widget type: icon