Skip to content

Struct ui::Button

zaun_client::ui::Button · Struct

pub struct Button(…)

A button: one that sends an interaction (custom_id), or a link the reader confirms.

pub fn primary<impl Into<String>, impl Into<String>>(custom_id: impl Into<String>, label: impl Into<String>) -> Self

A blue button.

pub fn secondary<impl Into<String>, impl Into<String>>(custom_id: impl Into<String>, label: impl Into<String>) -> Self

A grey button.

pub fn success<impl Into<String>, impl Into<String>>(custom_id: impl Into<String>, label: impl Into<String>) -> Self

A green button.

pub fn danger<impl Into<String>, impl Into<String>>(custom_id: impl Into<String>, label: impl Into<String>) -> Self

A red button.

pub fn link<impl Into<String>, impl Into<String>>(url: impl Into<String>, label: impl Into<String>) -> Self

A link (https:// only); readers confirm before it opens.

pub fn emoji<impl Into<String>>(self, emoji: impl Into<String>) -> Self

Adds a Unicode emoji.

pub const fn disabled(self, disabled: bool) -> Self

Shown but not clickable.

pub fn build(self) -> Component

The component.

Clone, Debug, Eq, PartialEq, StructuralPartialEq

Full rustdoc page