FAB
- Web Components
- Flutter
Demo
zeta-web v0.6.6
Web Components
Floating action buttons are used for a promoted action.
Storybook
https://design.zebra.com/web/storybook/?path=/docs/components-fabs--docs
Slots
Name | Description | Type |
---|---|---|
default | The icon of the button. Entered as a plain string. | text |
Attributes
Name | Description | Type | Default |
---|---|---|---|
label | The label display on or below the button. | string | "" |
round | The border radius of the button. Used in place of rounded prop. | boolean | "full" | undefined |
extended | Whether or not the FAB is extended. | boolean | false |
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' | 'inverse' | "primary" | Flavored |
size | Size of component | "small" | "medium" | "large" | "small" | 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 |
Demo
Zeta Floating Action Button Component.
Widgetbook
Inheritance
Object
> DiagnosticableTree
> Widget
> StatefulWidget
Constructors
Constructs ZetaFAB.
ZetaFAB.new({String? label, ScrollController? scrollController, VoidCallback? onPressed, ZetaFabType type = ZetaFabType.primary, ZetaFabSize size = ZetaFabSize.small, ZetaWidgetBorder shape = ZetaWidgetBorder.full, IconData icon = ZetaIcons.add, bool? expanded, FocusNode? focusNode, Key? key})
Properties
Name | Description | Type | Features |
---|---|---|---|
expanded | Whether the FAB starts as expanded. | bool | final |
focusNode | An optional focus node to use as the focus node for this widget. | FocusNode? | final |
hashCode | The hash code for this object. | int | no setter inherited |
icon | Icon for the button | IconData | final |
key | Controls how one widget replaces another widget in the tree. | Key? | final inherited |
label | The label of the button. | String? | final |
onPressed | Called when the button is tapped or otherwise activated. | VoidCallback? | final |
runtimeType | A representation of the runtime type of the object. | Type | no setter inherited |
scrollController | The ZetaFAB uses this controller to react to scroll change and shrink/expand itself. | ScrollController? | final |
shape | The shape for the button. | ZetaWidgetBorder | final |
size | The Size of the button. | ZetaFabSize | final |
type | Defines the color of the button. | ZetaFabType | final |
Methods
Name | Description | Type | Features |
---|---|---|---|
createElement() | Creates a StatefulElement to manage this widget's location in the tree. | StatefulElement | inherited |
createState() | Creates the mutable state for this widget at a given location in the tree. | State<ZetaFAB> | override |
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