plushie/widget/button
Button widget builder.
Types
pub type ButtonStyle {
Primary
Secondary
Success
Warning
Danger
TextStyle
BackgroundStyle
Subtle
Custom(style_map.StyleMap)
}
Constructors
-
Primary -
Secondary -
Success -
Warning -
Danger -
TextStyle -
BackgroundStyle -
Subtle -
Custom(style_map.StyleMap)Reusable-design-token style: pass a StyleMap for background, text_color, border, shadow, and state overrides. Matches the pattern Elixir / Python / TypeScript / Ruby already use.
Option type for button properties.
pub type Opt {
Style(ButtonStyle)
Width(length.Length)
Height(length.Length)
Padding(padding.Padding)
Clip(Bool)
Disabled(Bool)
A11y(a11y.A11y)
}
Constructors
-
Style(ButtonStyle) -
Width(length.Length) -
Height(length.Length) -
Padding(padding.Padding) -
Clip(Bool) -
Disabled(Bool) -
A11y(a11y.A11y)
Values
pub fn height_animated(
button: Button,
animation: node.PropValue,
) -> Button
Set height to an animation descriptor (Transition, Spring, or Sequence).
The descriptor must be pre-encoded via its module’s encode function.
pub fn new(id: String, label: String) -> Button
Create a new button builder with the given ID and label.
pub fn padding_animated(
button: Button,
animation: node.PropValue,
) -> Button
Set padding to an animation descriptor (Transition, Spring, or Sequence).
The descriptor must be pre-encoded via its module’s encode function.
pub fn width_animated(
button: Button,
animation: node.PropValue,
) -> Button
Set width to an animation descriptor (Transition, Spring, or Sequence).
The descriptor must be pre-encoded via its module’s encode function.