Button class
A styled button component.
Can render as either a <button> or <a> element depending on whether
href is provided. Use href for CTA buttons that navigate to other pages.
icon is the only semantic icon slot and iconPosition places that one
icon before or after the label.
- Inheritance
Constructors
-
Button({String? label, ArcaneGlyph? icon, ButtonIconPosition iconPosition = ButtonIconPosition.leading, void onPressed()?, ArcaneInteraction? action, ButtonVariant variant = ButtonVariant.primary, ButtonSize size = ButtonSize.medium, bool disabled = false, bool loading = false, bool fullWidth = false, Map<
String, String> ? attributes, String? id, ButtonType type = ButtonType.button, String? href, ArcaneStyleData? styles, ArcaneDecoration? decoration, Key? key}) -
const
-
Button.destructive({String? label, ArcaneGlyph? icon, ButtonIconPosition iconPosition = ButtonIconPosition.leading, void onPressed()?, ArcaneInteraction? action, ButtonSize size = ButtonSize.medium, bool disabled = false, bool loading = false, bool fullWidth = false, Map<
String, String> ? attributes, String? id, ButtonType type = ButtonType.button, String? href, ArcaneStyleData? styles, ArcaneDecoration? decoration, Key? key}) -
const
-
Button.ghost({String? label, ArcaneGlyph? icon, ButtonIconPosition iconPosition = ButtonIconPosition.leading, void onPressed()?, ArcaneInteraction? action, ButtonSize size = ButtonSize.medium, bool disabled = false, bool loading = false, bool fullWidth = false, Map<
String, String> ? attributes, String? id, ButtonType type = ButtonType.button, String? href, ArcaneStyleData? styles, ArcaneDecoration? decoration, Key? key}) -
const
-
Button.info({String? label, ArcaneGlyph? icon, ButtonIconPosition iconPosition = ButtonIconPosition.leading, void onPressed()?, ArcaneInteraction? action, ButtonSize size = ButtonSize.medium, bool disabled = false, bool loading = false, bool fullWidth = false, Map<
String, String> ? attributes, String? id, ButtonType type = ButtonType.button, String? href, ArcaneStyleData? styles, ArcaneDecoration? decoration, Key? key}) -
const
-
Button.link({String? label, ArcaneGlyph? icon, ButtonIconPosition iconPosition = ButtonIconPosition.leading, void onPressed()?, ArcaneInteraction? action, ButtonSize size = ButtonSize.medium, bool disabled = false, bool loading = false, bool fullWidth = false, Map<
String, String> ? attributes, String? id, ButtonType type = ButtonType.button, String? href, ArcaneStyleData? styles, ArcaneDecoration? decoration, Key? key}) -
const
-
Button.outline({String? label, ArcaneGlyph? icon, ButtonIconPosition iconPosition = ButtonIconPosition.leading, void onPressed()?, ArcaneInteraction? action, ButtonSize size = ButtonSize.medium, bool disabled = false, bool loading = false, bool fullWidth = false, Map<
String, String> ? attributes, String? id, ButtonType type = ButtonType.button, String? href, ArcaneStyleData? styles, ArcaneDecoration? decoration, Key? key}) -
const
-
Button.primary({String? label, ArcaneGlyph? icon, ButtonIconPosition iconPosition = ButtonIconPosition.leading, void onPressed()?, ArcaneInteraction? action, ButtonSize size = ButtonSize.medium, bool disabled = false, bool loading = false, bool fullWidth = false, Map<
String, String> ? attributes, String? id, ButtonType type = ButtonType.button, String? href, ArcaneStyleData? styles, ArcaneDecoration? decoration, Key? key}) -
const
-
Button.secondary({String? label, ArcaneGlyph? icon, ButtonIconPosition iconPosition = ButtonIconPosition.leading, void onPressed()?, ArcaneInteraction? action, ButtonSize size = ButtonSize.medium, bool disabled = false, bool loading = false, bool fullWidth = false, Map<
String, String> ? attributes, String? id, ButtonType type = ButtonType.button, String? href, ArcaneStyleData? styles, ArcaneDecoration? decoration, Key? key}) -
const
-
Button.success({String? label, ArcaneGlyph? icon, ButtonIconPosition iconPosition = ButtonIconPosition.leading, void onPressed()?, ArcaneInteraction? action, ButtonSize size = ButtonSize.medium, bool disabled = false, bool loading = false, bool fullWidth = false, Map<
String, String> ? attributes, String? id, ButtonType type = ButtonType.button, String? href, ArcaneStyleData? styles, ArcaneDecoration? decoration, Key? key}) -
const
-
Button.warning({String? label, ArcaneGlyph? icon, ButtonIconPosition iconPosition = ButtonIconPosition.leading, void onPressed()?, ArcaneInteraction? action, ButtonSize size = ButtonSize.medium, bool disabled = false, bool loading = false, bool fullWidth = false, Map<
String, String> ? attributes, String? id, ButtonType type = ButtonType.button, String? href, ArcaneStyleData? styles, ArcaneDecoration? decoration, Key? key}) -
const
Properties
- action → ArcaneInteraction?
-
final
-
attributes
→ Map<
String, String> ? -
final
- decoration → ArcaneDecoration?
-
Semantic, theme-interpreted decoration.
final
- disabled → bool
-
final
- fullWidth → bool
-
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- href → String?
-
If provided, renders the button as an anchor tag (
<a>) instead of<button>. Useful for CTA buttons that navigate to other pages.final - icon → ArcaneGlyph?
-
final
- iconPosition → ButtonIconPosition
-
final
- id → String?
-
final
- key → Key?
-
Controls how one component replaces another component in the tree.
finalinherited
- label → String?
-
final
- loading → bool
-
final
- onPressed → void Function()?
-
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- size → ButtonSize
-
final
- styles → ArcaneStyleData?
-
Literal, theme-permeable style override (always applied, wins over theme).
final
- type → ButtonType
-
Native
<button type>used when this renders as a button. Ignored when href renders the control as an anchor.final - variant → ButtonVariant
-
final
Methods
-
build(
BuildContext context) → Widget -
Describes the part of the user interface represented by this component.
override
-
createElement(
) → Element -
Creates a StatelessElement to manage this component's location in the tree.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
shouldRebuild(
covariant Component newComponent) → bool -
Implement this method to determine whether a rebuild can be skipped.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited