ButtonProps

Struct ButtonProps 

Source
pub struct ButtonProps {
Show 47 fields pub children: Children, pub accesskey: MaybeProp<String>, pub autocapitalize: MaybeProp<String>, pub autofocus: MaybeProp<bool>, pub class: MaybeProp<String>, pub contenteditable: MaybeProp<String>, pub dir: MaybeProp<String>, pub draggable: MaybeProp<bool>, pub enterkeyhint: MaybeProp<String>, pub exportparts: MaybeProp<String>, pub hidden: MaybeProp<String>, pub id: MaybeProp<String>, pub inert: MaybeProp<bool>, pub inputmode: MaybeProp<String>, pub is: MaybeProp<String>, pub itemid: MaybeProp<String>, pub itemprop: MaybeProp<String>, pub itemref: MaybeProp<String>, pub itemscope: MaybeProp<String>, pub itemtype: MaybeProp<String>, pub lang: MaybeProp<String>, pub nonce: MaybeProp<String>, pub part: MaybeProp<String>, pub popover: MaybeProp<String>, pub role: MaybeProp<String>, pub slot: MaybeProp<String>, pub spellcheck: MaybeProp<String>, pub style: MaybeProp<String>, pub tabindex: MaybeProp<usize>, pub title: MaybeProp<String>, pub translate: MaybeProp<String>, pub command: MaybeProp<String>, pub commandfor: MaybeProp<String>, pub disabled: MaybeProp<bool>, pub form: MaybeProp<String>, pub formaction: MaybeProp<String>, pub formenctype: MaybeProp<String>, pub formmethod: MaybeProp<String>, pub formnovalidate: MaybeProp<bool>, pub formtarget: MaybeProp<String>, pub name: MaybeProp<String>, pub popovertarget: MaybeProp<String>, pub popovertargetaction: MaybeProp<String>, pub value: MaybeProp<String>, pub button_type: MaybeProp<String>, pub size: MaybeProp<String>, pub variant: MaybeProp<String>,
}
Expand description

Props for the Button component.

Displays a button.

§Required Props

§Optional Props

Fields§

§children: Children§accesskey: MaybeProp<String>

A space separated list of keys to focus this element. The first key available on the user’s keyboard layout is used.

§autocapitalize: MaybeProp<String>

Sets whether the input value should be capitalized and how. If a parent <form> has autocapitalize rules set, it will override any rules set here.

Accepted values: “none” or “off” | “sentences” or “on” | “words” | “characters”.

§autofocus: MaybeProp<bool>

Grabs focus once the page has finished loading. Only one element on the page can be focused at a time.

§class: MaybeProp<String>

Apply classes to the element.

§contenteditable: MaybeProp<String>

Allows client-side editing of the element by the user.

Accepted values: “true” | “false” | “plaintext-only”

§dir: MaybeProp<String>

Indicate directionality of the element’s text.

Accepted values: “ltr” | “rtl” | “auto”

§draggable: MaybeProp<bool>

Toggle whether the element can be dragged.

§enterkeyhint: MaybeProp<String>

Modifies the appearance of the enter key on virtual keyboards.

§exportparts: MaybeProp<String>

Expose elements in the shadow DOM to be manipulated by the DOM.

§hidden: MaybeProp<String>

Controls hidden status of the element.

§id: MaybeProp<String>

Set the id of this element.

§inert: MaybeProp<bool>

Toggle if the browser reacts to input events from this element.

§inputmode: MaybeProp<String>

Hints to the browser of what type of virtual keyboard to display when editing this element or its children.

§is: MaybeProp<String>

Used to render a standard element as a custom element.

§itemid: MaybeProp<String>

Unique global identifier of an item.

§itemprop: MaybeProp<String>

Used to add properties to an item.

§itemref: MaybeProp<String>

Used to associate an item with a related non-parent element that’s using itemscope.

§itemscope: MaybeProp<String>

Used to declare that children elements are related to a particular item.

§itemtype: MaybeProp<String>

URL of data used to define itemprops.

§lang: MaybeProp<String>

Defines the language of an element.

§nonce: MaybeProp<String>

Cryptographic “number used once”.

§part: MaybeProp<String>

List of the part names of the element.

§popover: MaybeProp<String>

Designate an element as a popover element.

§role: MaybeProp<String>

Define the semantic meaning of content.

§slot: MaybeProp<String>

Assigns a slot to an element.

§spellcheck: MaybeProp<String>

Toggle spellcheck for this input.

Accepted values: “default” | “true” | “false”.

§style: MaybeProp<String>

Define CSS to be applied to the element.

§tabindex: MaybeProp<usize>

Controls how an element behaves when a user navigates using the tab key.

§title: MaybeProp<String>

Describes the content of the element to screen readers.

§translate: MaybeProp<String>

Defines localization behavior for the element.

§command: MaybeProp<String>

The action that’s performed by the element this button controls.

Accepted values: “show-modal” | “close” | “request-close” | “show-popover” | “hide-popover” | “toggle-popover” | “–[custom value]”

§commandfor: MaybeProp<String>

Turn this button into a command button for an element via id.

§disabled: MaybeProp<bool>

Toggle whether or not the input is disabled.

§form: MaybeProp<String>

Associate this element with a form element that may not be its parent by its id.

§formaction: MaybeProp<String>

Defines the target for submitted form data. Overrides any parent <form> action values.

§formenctype: MaybeProp<String>

Defines the encoding type for submitted form data. Overrides any parent <form> formenctype values.

Accepted values: “application/x-www-form-urlencoded” | “multipart/form-data” | “text/plain”.

§formmethod: MaybeProp<String>

Defines the HTTP method used to submit form data. Overrides any parent <form> method values.

Accepted values: “get” | “post” | “dialog”.

§formnovalidate: MaybeProp<bool>

Toggle whether the form data is validated or not before submission. Overrides any parent <form> novalidate values.

§formtarget: MaybeProp<String>

Defines where to display the response received after submission. Overrides any parent <form> target values.

Accepted values: “_self” | “_blank” | “_parent” | “_top”, or the name of any tab, window, or iframe

§name: MaybeProp<String>

Name of this element. Submitted with the form as part of a name/value pair.

§popovertarget: MaybeProp<String>

Id of a popover to control.

§popovertargetaction: MaybeProp<String>

The action to perform on the target popover.

Accepted values: “hide” | “show” | “toggle”

§value: MaybeProp<String>

The value associated with this button’s name when submitted with form data.

§button_type: MaybeProp<String>

The type of the button. Defaults to submit: Button types: submit | button | reset

§size: MaybeProp<String>

The size of the button. Leave this empty for the default size. Sizes: small | large | icon | sm-icon | lg-icon

§variant: MaybeProp<String>

The display variant of the button. Defaults to primary Variants: primary | secondary | outline | ghost | link | destructive

Implementations§

Source§

impl ButtonProps

Source

pub fn builder() -> ButtonPropsBuilder<((), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), ())>

Create a builder for building ButtonProps. On the builder, call .children(...), .accesskey(...)(optional), .autocapitalize(...)(optional), .autofocus(...)(optional), .class(...)(optional), .contenteditable(...)(optional), .dir(...)(optional), .draggable(...)(optional), .enterkeyhint(...)(optional), .exportparts(...)(optional), .hidden(...)(optional), .id(...)(optional), .inert(...)(optional), .inputmode(...)(optional), .is(...)(optional), .itemid(...)(optional), .itemprop(...)(optional), .itemref(...)(optional), .itemscope(...)(optional), .itemtype(...)(optional), .lang(...)(optional), .nonce(...)(optional), .part(...)(optional), .popover(...)(optional), .role(...)(optional), .slot(...)(optional), .spellcheck(...)(optional), .style(...)(optional), .tabindex(...)(optional), .title(...)(optional), .translate(...)(optional), .command(...)(optional), .commandfor(...)(optional), .disabled(...)(optional), .form(...)(optional), .formaction(...)(optional), .formenctype(...)(optional), .formmethod(...)(optional), .formnovalidate(...)(optional), .formtarget(...)(optional), .name(...)(optional), .popovertarget(...)(optional), .popovertargetaction(...)(optional), .value(...)(optional), .button_type(...)(optional), .size(...)(optional), .variant(...)(optional) to set the values of the fields. Finally, call .build() to create the instance of ButtonProps.

Trait Implementations§

Source§

impl Props for ButtonProps

Source§

type Builder = ButtonPropsBuilder

Source§

fn builder() -> Self::Builder

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<E, T, Request, Encoding> FromReq<Patch<Encoding>, Request, E> for T
where Request: Req<E> + Send + 'static, Encoding: Decodes<T>, E: FromServerFnError,

Source§

async fn from_req(req: Request) -> Result<T, E>

Attempts to deserialize the arguments from a request.
Source§

impl<E, T, Request, Encoding> FromReq<Post<Encoding>, Request, E> for T
where Request: Req<E> + Send + 'static, Encoding: Decodes<T>, E: FromServerFnError,

Source§

async fn from_req(req: Request) -> Result<T, E>

Attempts to deserialize the arguments from a request.
Source§

impl<E, T, Request, Encoding> FromReq<Put<Encoding>, Request, E> for T
where Request: Req<E> + Send + 'static, Encoding: Decodes<T>, E: FromServerFnError,

Source§

async fn from_req(req: Request) -> Result<T, E>

Attempts to deserialize the arguments from a request.
Source§

impl<E, Encoding, Response, T> FromRes<Patch<Encoding>, Response, E> for T
where Response: ClientRes<E> + Send, Encoding: Decodes<T>, E: FromServerFnError,

Source§

async fn from_res(res: Response) -> Result<T, E>

Attempts to deserialize the outputs from a response.
Source§

impl<E, Encoding, Response, T> FromRes<Post<Encoding>, Response, E> for T
where Response: ClientRes<E> + Send, Encoding: Decodes<T>, E: FromServerFnError,

Source§

async fn from_res(res: Response) -> Result<T, E>

Attempts to deserialize the outputs from a response.
Source§

impl<E, Encoding, Response, T> FromRes<Put<Encoding>, Response, E> for T
where Response: ClientRes<E> + Send, Encoding: Decodes<T>, E: FromServerFnError,

Source§

async fn from_res(res: Response) -> Result<T, E>

Attempts to deserialize the outputs from a response.
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<E, T, Encoding, Request> IntoReq<Patch<Encoding>, Request, E> for T
where Request: ClientReq<E>, Encoding: Encodes<T>, E: FromServerFnError,

Source§

fn into_req(self, path: &str, accepts: &str) -> Result<Request, E>

Attempts to serialize the arguments into an HTTP request.
Source§

impl<E, T, Encoding, Request> IntoReq<Post<Encoding>, Request, E> for T
where Request: ClientReq<E>, Encoding: Encodes<T>, E: FromServerFnError,

Source§

fn into_req(self, path: &str, accepts: &str) -> Result<Request, E>

Attempts to serialize the arguments into an HTTP request.
Source§

impl<E, T, Encoding, Request> IntoReq<Put<Encoding>, Request, E> for T
where Request: ClientReq<E>, Encoding: Encodes<T>, E: FromServerFnError,

Source§

fn into_req(self, path: &str, accepts: &str) -> Result<Request, E>

Attempts to serialize the arguments into an HTTP request.
Source§

impl<E, Response, Encoding, T> IntoRes<Patch<Encoding>, Response, E> for T
where Response: TryRes<E>, Encoding: Encodes<T>, E: FromServerFnError + Send, T: Send,

Source§

async fn into_res(self) -> Result<Response, E>

Attempts to serialize the output into an HTTP response.
Source§

impl<E, Response, Encoding, T> IntoRes<Post<Encoding>, Response, E> for T
where Response: TryRes<E>, Encoding: Encodes<T>, E: FromServerFnError + Send, T: Send,

Source§

async fn into_res(self) -> Result<Response, E>

Attempts to serialize the output into an HTTP response.
Source§

impl<E, Response, Encoding, T> IntoRes<Put<Encoding>, Response, E> for T
where Response: TryRes<E>, Encoding: Encodes<T>, E: FromServerFnError + Send, T: Send,

Source§

async fn into_res(self) -> Result<Response, E>

Attempts to serialize the output into an HTTP response.
Source§

impl<T> SerializableKey for T

Source§

fn ser_key(&self) -> String

Serializes the key to a unique string. Read more
Source§

impl<T> StorageAccess<T> for T

Source§

fn as_borrowed(&self) -> &T

Borrows the value.
Source§

fn into_taken(self) -> T

Takes the value.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> ErasedDestructor for T
where T: 'static,