Icon Button
- Web Components
- Flutter
Demo
zeta-web v0.6.6
Web Components
ZetaIconButton web component.
A button containing a Zeta Icon.
Storybook
https://design.zebra.com/web/storybook/?path=/docs/components-buttons--docs
Slots
Name | Description | Type |
---|---|---|
default | The name of the icon. Full list of icons can be found at Zeta Icons. | ZetaIconName |
leadingIcon | Leading icon of button. Full list of icons can be found at Zeta Icons. | zeta-icon |
trailingIcon | Trailing icon of button. Full list of icons can be found at Zeta Icons | zeta-icon |
Inherited Attributes
Name | Description | Type | Default | Inherited From |
---|---|---|---|---|
flavor | Flavor of component.Values:* primary - blue background.* secondary - yellow background.* positive - green background.* negative - red background.* outline - primary outline only.* outline-subtle - grey outline only.* text - primary text only. | 'primary' | 'secondary' | 'positive' | 'negative' | 'outline' | 'outline-subtle' | 'text' | "primary" | Flavored |
size | Size of component | "small" | "medium" | "large" | "medium" | BaseButton |
rounded | Whether the component is rounded or sharp.When true, rounded will set the border radius of the first child, and any children with class 'contourable-target' to --radius-minimal .Otherwise, this value will be --radius-none . | boolean | undefined | true | BaseButton |
disabled | Boolean for if component is disabled.This will apply disabled styles. | boolean | false | BaseButton |
tabIndex | The tab index of the component, used to determine the order in which elements receive focus when the user navigates through the document by pressing the Tab key. | number | 0 | BaseButton |
type | The type of the button when used in a form | "submit" | "reset" | "button" | undefined | undefined | BaseButton |
name | Name for the button, used if the button is in a form. | string | undefined | undefined | BaseButton |
value | The value of the name property When submitted as part of a form | string | undefined | undefined | BaseButton |
CSS Properties
Name | Description |
---|---|
--icon-button-color | the color of the button. |
--icon-button-icon-color | the color of the icon. |
--icon-button-icon-color-disabled | the color of the icon when the button is disabled. |
Demo
Component ZetaIconButton
Widgetbook
Inheritance
Object
> DiagnosticableTree
> Widget
> StatelessWidget
> ZetaStatelessWidget
Constructors
Constructor for ZetaIconButton
ZetaIconButton.new({Key? key, bool? rounded, VoidCallback? onPressed, ZetaWidgetBorder? borderType, ZetaButtonType type = ZetaButtonType.primary, ZetaWidgetSize size = ZetaWidgetSize.medium, IconData icon = ZetaIcons.more_horizontal, String? semanticLabel})
Constructs ZetaIconButton with Negative theme.
ZetaIconButton.negative({Key? key, bool? rounded, VoidCallback? onPressed, ZetaWidgetSize size = ZetaWidgetSize.medium, ZetaWidgetBorder? borderType, required IconData icon, String? semanticLabel})
Constructs ZetaIconButton with Outline theme.
ZetaIconButton.outline({Key? key, bool? rounded, required IconData icon, VoidCallback? onPressed, ZetaWidgetSize size = ZetaWidgetSize.medium, ZetaWidgetBorder? borderType, String? semanticLabel})
Constructs ZetaIconButton with Outline Subtle theme.
ZetaIconButton.outlineSubtle({Key? key, bool? rounded, required IconData icon, VoidCallback? onPressed, ZetaWidgetSize size = ZetaWidgetSize.medium, ZetaWidgetBorder? borderType, String? semanticLabel})
Constructs ZetaIconButton with Positive theme.
ZetaIconButton.positive({Key? key, bool? rounded, required IconData icon, VoidCallback? onPressed, ZetaWidgetSize size = ZetaWidgetSize.medium, ZetaWidgetBorder? borderType, String? semanticLabel})
Constructs ZetaIconButton with Primary theme.
ZetaIconButton.primary({Key? key, bool? rounded, required IconData icon, VoidCallback? onPressed, ZetaWidgetSize size = ZetaWidgetSize.medium, ZetaWidgetBorder? borderType, String? semanticLabel})
Constructs ZetaIconButton with Secondary theme.
ZetaIconButton.secondary({Key? key, bool? rounded, required IconData icon, VoidCallback? onPressed, ZetaWidgetSize size = ZetaWidgetSize.medium, ZetaWidgetBorder? borderType, String? semanticLabel})
Constructs ZetaIconButton with text theme.
ZetaIconButton.text({Key? key, bool? rounded, required IconData icon, VoidCallback? onPressed, ZetaWidgetSize size = ZetaWidgetSize.medium, ZetaWidgetBorder? borderType, String? semanticLabel})
Properties
Name | Description | Type | Features |
---|---|---|---|
borderType | Whether or not the button is sharp or rounded | ZetaWidgetBorder? | final |
hashCode | The hash code for this object. | int | no setter inherited |
icon | Button icon. | IconData | final |
key | Controls how one widget replaces another widget in the tree. | Key? | final inherited |
onPressed | Called when the button is tapped or otherwise activated. | VoidCallback? | final |
rounded | Sets rounded or sharp border of the containing box and the icon style. | bool? | final inherited |
runtimeType | A representation of the runtime type of the object. | Type | no setter inherited |
semanticLabel | A semantic description of the button. | String? | final |
size | Size of the button. Defaults to large. | ZetaWidgetSize | final |
type | The coloring type of the button | ZetaButtonType | final |
Methods
Name | Description | Type | Features |
---|---|---|---|
build(BuildContext context) | Describes the part of the user interface represented by this widget. | Widget | override |
createElement() | Creates a StatelessElement to manage this widget's location in the tree. | StatelessElement | inherited |
debugDescribeChildren() | Returns a list of DiagnosticsNode objects describing this node's children. | List<DiagnosticsNode> | inherited |
debugFillProperties(DiagnosticPropertiesBuilder properties) | Add additional properties associated with the node. | void | override |
noSuchMethod(Invocation invocation) | Invoked when a nonexistent method or property is accessed. | dynamic | inherited |
paddingAll(double space) | Available on Widget, provided by the SpacingWidget extension | Widget | undefined |
paddingBottom(double space) | Available on Widget, provided by the SpacingWidget extension | Widget | undefined |
paddingEnd(double space) | Available on Widget, provided by the SpacingWidget extension | Widget | undefined |
paddingHorizontal(double space) | Available on Widget, provided by the SpacingWidget extension | Widget | undefined |
paddingStart(double space) | Available on Widget, provided by the SpacingWidget extension | Widget | undefined |
paddingTop(double space) | Available on Widget, provided by the SpacingWidget extension | Widget | undefined |
paddingVertical(double space) | Available on Widget, provided by the SpacingWidget extension | Widget | undefined |
toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) | Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep. | DiagnosticsNode | inherited |
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) | A string representation of this object. | String | inherited |
toStringDeep({String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) | Returns a string representation of this node and its descendants. | String | inherited |
toStringShallow({String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) | Returns a one-line detailed description of the object. | String | inherited |
toStringShort() | A short, textual description of this widget. | String | inherited |
Figma