pub struct ButtonProps {Show 16 fields
pub class: String,
pub children: Children,
pub block: bool,
pub disabled: bool,
pub name: String,
pub onclick: Callback<MouseEvent>,
pub outline: bool,
pub size: ButtonSize,
pub style: Color,
pub text: String,
pub modal_target: Option<String>,
pub modal_dismiss: bool,
pub url: Option<AttrValue>,
pub target: Option<AttrValue>,
pub node_ref: NodeRef,
pub id: Option<AttrValue>,
}
Fields§
§class: String
CSS class
children: Children
Optional children
block: bool
Treat button as block that spans the full width of the parent
disabled: bool
Status of the button. Disabled buttons cannot be clicked.
name: String
Name of the component
onclick: Callback<MouseEvent>
Event called when the button is clicked
outline: bool
Show button as outlined instead of filled
size: ButtonSize
Size of the button
style: Color
Color of the button, default Color::Primary
text: String
Text displayed in the button
modal_target: Option<String>
if provided, we will set data-bs-toggle and data-bs-target for modal opening
modal_dismiss: bool
true if this button dismisses the modal that contains it
url: Option<AttrValue>
URL to direct to when the button is clicked. This turns the button into
an <a>
element.
This property is ignored if the button is disabled
to
avoid link functionality caveats, which may result in
slightly different rendering on some browsers / platforms.
target: Option<AttrValue>
Target frame or window ID for the link. Only used if url
is set and
the button is not disabled
.
node_ref: NodeRef
Reference to the NodeRef of the button’s underlying <button>
or
<a>
element.
Used by components which add custom event handlers directly to the DOM.
See Node Refs in the Yew documentation for more information.
id: Option<AttrValue>
Optional HTML element ID for the underlying <button>
or <a>
element.
Trait Implementations§
Source§impl Clone for ButtonProps
impl Clone for ButtonProps
Source§fn clone(&self) -> ButtonProps
fn clone(&self) -> ButtonProps
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl PartialEq for ButtonProps
impl PartialEq for ButtonProps
Source§impl Properties for ButtonProps
impl Properties for ButtonProps
impl StructuralPartialEq for ButtonProps
Auto Trait Implementations§
impl Freeze for ButtonProps
impl !RefUnwindSafe for ButtonProps
impl !Send for ButtonProps
impl !Sync for ButtonProps
impl Unpin for ButtonProps
impl !UnwindSafe for ButtonProps
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoPropValue<Option<T>> for T
impl<T> IntoPropValue<Option<T>> for T
Source§fn into_prop_value(self) -> Option<T>
fn into_prop_value(self) -> Option<T>
self
to a value of a Properties
struct.Source§impl<T> IntoPropValue<T> for T
impl<T> IntoPropValue<T> for T
Source§fn into_prop_value(self) -> T
fn into_prop_value(self) -> T
self
to a value of a Properties
struct.