The Floating action button is a circular button defined in the Material Design specification. They are often used to promote the primary action of the app. It can be displayed either as an inline element or in one of the corners. Normally it will be positioned in the lower right corner of the screen.
The Floating action button is a Material Design component that displays a circular button. It is normally displayed in the lower right corner and is used to represent the primary action of the app.
It is displayed using the Fab
component. To specify the position the position
prop is used. To put an icon inside the button the Icon
component can be used.
<Fab position='bottom right'>
<Icon icon="md-face" />
</Fab>
In order for the Fab
component to be fixed when scrolling the page, it needs to be put outside the page. This can be archived by rendering it in the renderFixed function of the Page
component.
<Page renderFixed={() => <Fab />} />
Name | Type | Description |
---|---|---|
modifier | String | The appearance of the button. Optional. |
ripple | If this attribute is defined, the button will have a ripple effect when tapped. Optional. | |
position | String |
The position of the button. Should be a string like "bottom right" or "top left" . If this attribute is not defined it will be displayed as an inline element.
Optional.
|
disabled | Specify if button should be disabled. Optional. |
Name | Description |
---|---|
ripple | If this property is defined, the button will have a ripple effect when tapped. |
disabled | Whether the element is disabled or not. |
visible | Whether the element is visible or not. |
Name | Description |
---|---|
mini |
Makes the ons-fab smaller.
|
Signature | Description |
---|---|
show() | Show the floating action button. |
hide() | Hide the floating action button. |
toggle() | Toggle the visibility of the button. |
Show the floating action button.
Hide the floating action button.
Toggle the visibility of the button.
If you have any questions, use our Community Forum or talk to us on Discord chat. The Onsen UI team and your peers in the community will work together to help solve your issues.
For bug reports and feature requests use our GitHub Issues page.