Skip to main content

TappableChipAttributes

Trait TappableChipAttributes 

Source
pub trait TappableChipAttributes {
    // Required methods
    fn on_pressed(&self) -> Option<&Listener>;
    fn press_elevation(&self) -> Option<f64>;
    fn tooltip(&self) -> Option<&str>;
}
Expand description

An interface for Material Design chips that can be pressed.

The defaults mentioned in the documentation for each attribute are what the implementing classes typically use for defaults (but this class doesn’t provide or enforce them).

See also:

  • InputChip, a chip that represents a complex piece of information, such as an entity (person, place, or thing) or conversational text, in a compact form.
  • ActionChip, represents an action related to primary content.
  • https://material.io/design/components/chips.html

Required Methods§

Source

fn on_pressed(&self) -> Option<&Listener>

Called when the user taps the chip.

If on_pressed is set, then this callback will be called when the user taps on the label or avatar parts of the chip. If on_pressed is null, then the chip will be disabled.

Source

fn press_elevation(&self) -> Option<f64>

Elevation to be applied on the chip relative to its parent during the press motion.

This controls the size of the shadow below the chip.

Defaults to 8. The value is always non-negative.

Source

fn tooltip(&self) -> Option<&str>

Tooltip string to be used for the body area (where the label and avatar are) of the chip.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§