Skip to content

Button

A native SwiftUI button with text, SF Symbol, semantic role, and press handling.

#Import

Import SwiftUiButton from quickgui.

use quickgui::*;

#Usage

SwiftUiButton::new(1)
    .label("Save")
    .system_image("checkmark")
    .style(SwiftUiButtonStyle::BorderedProminent)

#API reference

Expand an entry for its description and complete signature. A dash means no declaration default is documented.

SwiftUiButton

View source
pub fn new(id: u64) -> Self
labelpub fn label(mut self, label: impl Into<Arc<str>>) -> Self—

Configures label for this part.

pub fn label(mut self, label: impl Into<Arc<str>>) -> Self
View source
system_imagepub fn system_image(mut self, name: impl Into<Arc<str>>) -> Self—

Configures system image for this part.

pub fn system_image(mut self, name: impl Into<Arc<str>>) -> Self
View source
rolepub fn role(mut self, role: SwiftUiButtonRole) -> Self—

Configures role for this part.

pub fn role(mut self, role: SwiftUiButtonRole) -> Self
View source
targetpub fn target(mut self, target: impl Into<Arc<str>>) -> Self—

Configures target for this part.

pub fn target(mut self, target: impl Into<Arc<str>>) -> Self
View source
test_idpub fn test_id(mut self, test_id: impl Into<Arc<str>>) -> Self—

Configures test id for this part.

pub fn test_id(mut self, test_id: impl Into<Arc<str>>) -> Self
View source
modifierpub fn modifier(mut self, modifier: SwiftUiModifier) -> Self—

Configures modifier for this part.

pub fn modifier(mut self, modifier: SwiftUiModifier) -> Self
View source
modifierspub fn modifiers(mut self, modifiers: impl IntoIterator<Item = SwiftUiModifier>) -> Self—

Configures modifiers for this part.

pub fn modifiers(mut self, modifiers: impl IntoIterator<Item = SwiftUiModifier>) -> Self
View source
stylepub fn style(mut self, style: SwiftUiButtonStyle) -> Self—

Convenience builder equivalent to Expo's `buttonStyle` modifier.

pub fn style(mut self, style: SwiftUiButtonStyle) -> Self
View source
control_sizepub fn control_size(mut self, size: SwiftUiControlSize) -> Self—

Convenience builder equivalent to Expo's `controlSize` modifier.

pub fn control_size(mut self, size: SwiftUiControlSize) -> Self
View source
disabledpub fn disabled(mut self, disabled: bool) -> Self—

Convenience builder equivalent to Expo's `disabled` modifier.

pub fn disabled(mut self, disabled: bool) -> Self
View source
actionpub fn action(mut self, enabled: bool) -> Self—

Configures action for this part.

pub fn action(mut self, enabled: bool) -> Self
View source