VOOZH about

URL: https://quasar.dev/vue-components/floating-action-button/

⇱ Floating Action Button | Quasar Framework


assignment_late
Why donate
travel_explore
API Explorer
build
Quasar CLI (with Vite)
Upgrade Guide
Creating a New Project
The /quasar.config File
Convert q/app-webpack Project
Browser Compatibility
TypeScript Support
Directory Structure
Commands List
CSS Preprocessors
Page Routing with VueRouter
Lazy Loading - Code Splitting
Handling Assets
Boot Files
Prefetch Feature
API Proxying
Handling Vite
Handling import.meta.env
State Management with Pinia
Lint and Format Code
Testing & Auditing
Developing Mobile Apps
Ajax Requests
Opening Dev Server To Public
build
Quasar CLI (with Webpack)
Floating Action Button

A Floating Action Button (FAB) represents the primary action in a Page. But, it’s not limited to only a single action. It can contain any number of sub-actions too. And more importantly, it can also be used inline in your Pages or Layouts.

Note that you don’t need a QLayout to use FABs.

Loading QFab API...
Loading QFabAction API...

Usage

There are two types of FABs: expandable (has sub-actions) and non-expandable.

TIP

For an exhausting list of options, please read the API cards (at the top of this page).

Non-Expandable

If you want a non-expandable FAB, all you need is a round button – wrapped in QPageSticky if used on a QLayout.

Non expandable


Expandable

Expandable


Internal labels

Internal label


Toggling internal label


When the labels are internal and your QFab opens up vertically (up or down) then you also have the ability to choose how to vertically align the sub-actions:

Vertical actions alignment


External labels

By default, when the label is external on the main QFab (not the sub-actions), it gets shown only when QFab is opened. However, you can override that by setting a Boolean value for hide-label prop.

External label


Custom styled external label


Toggling external label


Hide icons

If we hide the icon (through specific prop), we should at least use an internal label:

Hide icon


Padding

The default padding for QFab is “md” and for QFabAction is “sm”. However, you can use padding prop to customize it (accepts CSS units too):

Playing with padding


Square style

Square style


Slots
v2.4+

Notice the slots for QFab and the slots for QFabAction below:

Slots: icon, active-icon and label


With QPageSticky

With QPageSticky


Draggable

Below is a nice example of using TouchPan for making the QFab draggable across the screen.

Draggable



Caught a mistake?Edit this page in browser
1. Introduction
2. QFab API
3. QFabAction API
4. Usage
4.1. Non-Expandable
4.2. Expandable
4.3. Internal labels
4.4. External labels
4.5. Hide icons
4.6. Padding
4.7. Square style
4.8. Slots
4.9. With QPageSticky
4.10. Draggable
Copyright © 2015-present PULSARDEV SRL, Razvan Stoenescu