pub struct QRCodeProps {Show 14 fields
pub value: String,
pub type: QRCodeType,
pub size: u32,
pub icon: Option<String>,
pub icon_size: Option<u32>,
pub color: Option<String>,
pub bg_color: Option<String>,
pub error_level: QRCodeErrorLevel,
pub status: QRCodeStatus,
pub bordered: bool,
pub on_refresh: Option<EventHandler<()>>,
pub class: Option<String>,
pub root_class: Option<String>,
pub style: Option<String>,
}Expand description
Props for the QRCode component.
Fields§
§value: StringThe value/content to encode in the QR code.
type: QRCodeTypeRendering type (SVG or Canvas). Defaults to SVG.
size: u32Size of the QR code in pixels. Defaults to 160.
icon: Option<String>Icon URL to display in the center.
icon_size: Option<u32>Size of the icon. Can be a single number or width/height.
color: Option<String>Foreground color of the QR code. Defaults to current text color.
bg_color: Option<String>Background color of the QR code. Defaults to transparent.
error_level: QRCodeErrorLevelError correction level. Defaults to M.
status: QRCodeStatusCurrent status of the QR code.
bordered: boolWhether to show border. Defaults to true.
on_refresh: Option<EventHandler<()>>Callback when refresh is clicked (for expired status).
class: Option<String>Extra class name for the container.
root_class: Option<String>Extra class name for the root element.
style: Option<String>Inline style for the container.
Implementations§
Source§impl QRCodeProps
impl QRCodeProps
Sourcepub fn builder() -> QRCodePropsBuilder<((), (), (), (), (), (), (), (), (), (), (), (), (), ())>
pub fn builder() -> QRCodePropsBuilder<((), (), (), (), (), (), (), (), (), (), (), (), (), ())>
Create a builder for building QRCodeProps.
On the builder, call .value(...), .r#type(...)(optional), .size(...)(optional), .icon(...)(optional), .icon_size(...)(optional), .color(...)(optional), .bg_color(...)(optional), .error_level(...)(optional), .status(...)(optional), .bordered(...)(optional), .on_refresh(...)(optional), .class(...)(optional), .root_class(...)(optional), .style(...)(optional) to set the values of the fields.
Finally, call .build() to create the instance of QRCodeProps.
Trait Implementations§
Source§impl Clone for QRCodeProps
impl Clone for QRCodeProps
Source§fn clone(&self) -> QRCodeProps
fn clone(&self) -> QRCodeProps
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more