pub struct ButtonProps<'__a> {
pub variant: ButtonVariant,
pub size: ButtonSize,
pub attrs: Attributes,
pub child: Child<'__a>,
}Expand description
A styled button.
variant defaults to Primary and size to Md. Pass the content as children.
attrs are forwarded to the <button>, with extra classes added to its classes.
Use button_variants to apply the same styling to another element.
ⓘ
view! {
button(
variant: ButtonVariant::Destructive,
attrs: attributes! { type="submit" },
"Delete"
)
}Fields§
§variant: ButtonVariant§size: ButtonSize§attrs: Attributes§child: Child<'__a>Implementations§
Source§impl<'__a> ButtonProps<'__a>
impl<'__a> ButtonProps<'__a>
Sourcepub fn builder() -> ButtonPropsBuilder<'__a>
pub fn builder() -> ButtonPropsBuilder<'__a>
Returns a ButtonPropsBuilder with no properties set.
Trait Implementations§
Auto Trait Implementations§
impl<'__a> !RefUnwindSafe for ButtonProps<'__a>
impl<'__a> !Sync for ButtonProps<'__a>
impl<'__a> !UnwindSafe for ButtonProps<'__a>
impl<'__a> Freeze for ButtonProps<'__a>
impl<'__a> Send for ButtonProps<'__a>
impl<'__a> Unpin for ButtonProps<'__a>
impl<'__a> UnsafeUnpin for ButtonProps<'__a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more