Skip to main content

Button

Function Button 

Source
pub fn Button(_: ButtonProps) -> Element
Expand description

The variant is the seam the design system’s component rule attaches to. The same rsx draws differently per system, and that is correct behaviour.

§Props

For details, see the props struct definition.

  • weight : Option<f32>
  • width : Option<f32>
  • height : Option<f32>
  • padding : Option<f32>
  • padding_role : Option<SpaceRole>
  • background : Option<Paint>
  • shape_role : Option<ShapeRole>
  • corner_radius : Option<f32>
  • border_width : Option<f32>
  • border_color : Option<Paint>
  • elevation : Option<f32>
  • fill_max_width : bool
  • fill_max_height : bool
  • text : String
  • icon : Option<IconRole>

    The meaning of the glyph on it, never a picture: IconRole::Search comes out as this design system’s search icon.

    With a text beside it the button shows both. With text empty it is the glyph alone, which is what every one of the reference toolbars is made of, and the role is what names it for assistive technology.

  • enabled : bool
  • variant : Option<ButtonVariant>
  • color : Option<Paint>

    The label’s colour, for the rare button whose meaning is not the variant’s. A destructive action is the case that needs it: it is a plain button in every design system, and what marks it is that its label is the error colour.

  • on_click : EventHandler<()>