Actions

FloatingActionButtons

A draggable, edge-snapping floating group of action buttons.

html
<UiFloatingActionButtons />

Default side

defaultSide is the edge the group starts snapped to when you let it manage its own position. Drag the pill by its grip — or by any empty space in it — towards another edge of the box and it snaps to whichever is nearest, switching between a horizontal and a vertical layout as it crosses. defaultSide is only the starting point, so it's ignored the moment you pass position.

Drag either pill towards an edge — it snaps to the nearest one

Position

position takes the side away from the component and puts it in your hands. Pass it — with v-model:position if you also want dragging to write back — and the group sits where you say; omit it and the group keeps its own side internally, starting from defaultSide. Useful when the edge has to follow something else on the page, like a panel that opens on the right.

Handle

handle shows the drag grip at the end of the pill. Turning it off doesn't stop the group being dragged — empty space and the buttons themselves still work — it only removes the affordance that says so, which is worth doing when the grip would be the widest thing in a two-button group.

Draggable

draggable is the one that actually pins the group down. Set it to false and the pill stays on the side it was given, grip and all gestures inert — the right setting for a toolbar whose position is part of the layout rather than a preference.

This pill can't be moved

A real drag (movement past a small threshold) suppresses the click that would otherwise fire on release — so dragging a button around doesn't also trigger its @click.

Margin

margin is the distance in pixels kept between the group and the edge of its bounds, whether that's the viewport or a container you named.

Container

container confines the group to one element's box instead of the viewport. Pass a template ref: dragging, snapping and margin are all measured against that element, which is what every preview on this page does — without it the pill would be position: fixed and drag across the whole page.

Bounded to this box — drag it and it never leaves

Without a container prop it's position: fixed and drags across the whole viewport; pass a container element ref to confine it (and switch it to position: absolute, scrolling with that container).


API Reference

Generated from the component's source — props, slots and emits as the component actually declares them.

Props

Prop
Type
Default
Description
"top" | "bottom" | "left" | "right"
'right'
Which viewport edge the group starts snapped to. Ignored once `position` is passed.
"top" | "bottom" | "left" | "right"
Controls which viewport edge the group is snapped to. Omit this to let the group manage its own position internally (starting from `defaultSide`); pass it to fully control the side yourself.
boolean
true
Shows the drag grip.
boolean
true
Whether the group can be dragged to a different edge/position at all.
number
16
Distance in pixels kept between the group and the edge of its bounds.
HTMLElement | null
undefined (the viewport)
Confines dragging/snapping to this element's box instead of the whole viewport — e.g. pass a template ref to keep a FAB group inside a specific container.

Slots

Slot
default

Emits

Event
Payload
Description
update:position
[value: Side]

Types

ts
type Side = "top" | "bottom" | "left" | "right";