FloatButton
A circular or square button floating over the page, often placed in the bottom-right corner for global actions such as Help, Feedback, or Create. It supports tooltips, badges, and an expandable menu of child buttons. Use HuiFloatButtonGroup to arrange several buttons vertically.
Import
import { HuiFloatButton, HuiFloatButtonGroup } from '@nscode/handy-ui'
Basic Usage
icon is an icon name. tooltip is the text shown on hover or focus, on the left by default. The default position="fixed" uses offsets such as right and bottom; numbers are pixels and strings are used as provided, such as '10%'.
To keep buttons within the example area, examples on this page use position="absolute" relative to a position: relative container, or position="relative" to keep the button in the normal layout. The next section compares all three positioning modes.
<script setup lang="ts">
import { HuiFloatButton, HuiMessage } from '@nscode/handy-ui'
const openHelp = () => {
HuiMessage.info('Open the help center')
}
</script>
<template>
<div class="stage">
<HuiFloatButton
icon="help"
tooltip="Help center"
position="absolute"
:right="24"
:bottom="24"
@click="openHelp"
/>
</div>
</template>
<style scoped>
.stage {
position: relative;
height: 120px;
border: 1px dashed var(--hui-border-color);
border-radius: var(--hui-border-radius);
background-color: var(--hui-bg-color-page);
}
</style>
For an icon-only button, tooltip supplies the accessible name (aria-label). Provide either tooltip or an explicit aria-label; otherwise, a warning is logged in development.
Positioning
position accepts:
fixed(the default): fixed to the browser viewport and unaffected by page scrolling. Its z-index followsHuiConfigProvider.zIndex(2000 by default).absolute: positioned relative to the nearest positioned ancestor (an element whosepositionis notstatic). Useleft,right,top, andbottomto place it within that region.relative: remains in the normal layout alongside surrounding content. Offsets such asleftare relative to its original position.
Enable the switch below to show the fixed button in the browser window's bottom-right corner:
<script setup lang="ts">
import { ref } from 'vue'
import { HuiFloatButton, HuiSpace, HuiSwitch } from '@nscode/handy-ui'
const showFixed = ref(false)
</script>
<template>
<HuiSpace direction="vertical" fill>
<HuiSwitch
v-model="showFixed"
active-text="Show the fixed button (bottom-right of the window)"
/>
<div class="stage">
<HuiSpace>
<span>relative, in the normal layout:</span>
<HuiFloatButton icon="star" tooltip="relative" position="relative" />
</HuiSpace>
<HuiFloatButton
icon="bell"
tooltip="absolute, bottom-right of the example"
type="primary"
position="absolute"
:right="24"
:bottom="24"
/>
</div>
</HuiSpace>
<HuiFloatButton
v-if="showFixed"
icon="heart"
tooltip="fixed, bottom-right of the window"
type="primary"
:right="40"
:bottom="40"
/>
</template>
<style scoped>
.stage {
position: relative;
height: 120px;
padding: 16px;
border: 1px dashed var(--hui-border-color);
border-radius: var(--hui-border-radius);
background-color: var(--hui-bg-color-page);
}
</style>
Types and Shapes
type:default(the default, with a white background) orprimary(a primary-colored background with a white icon).shape:circle(the default) orsquare(a rounded square with an 8px corner radius).
<template>
<HuiSpace size="large">
<HuiFloatButton icon="help" tooltip="default + circle" position="relative" />
<HuiFloatButton icon="plus" type="primary" tooltip="primary + circle" position="relative" />
<HuiFloatButton icon="bell" shape="square" tooltip="default + square" position="relative" />
<HuiFloatButton
icon="edit"
type="primary"
shape="square"
tooltip="primary + square"
position="relative"
/>
</HuiSpace>
</template>
Tooltip Placement
tooltip-placement sets the tooltip position, defaulting to left. It supports 12 placements and flips to the other side when there is insufficient space. Hover over the buttons below; their descriptions identify each placement:
<template>
<HuiSpace direction="vertical" align="start">
<HuiSpace wrap>
<HuiFloatButton
shape="square"
icon="arrow-up"
description="top"
tooltip="top"
tooltip-placement="top"
position="relative"
:width="96"
/>
<HuiFloatButton
shape="square"
icon="arrow-up"
description="top-start"
tooltip="top-start"
tooltip-placement="top-start"
position="relative"
:width="96"
/>
<HuiFloatButton
shape="square"
icon="arrow-up"
description="top-end"
tooltip="top-end"
tooltip-placement="top-end"
position="relative"
:width="96"
/>
<HuiFloatButton
shape="square"
icon="arrow-down"
description="bottom"
tooltip="bottom"
tooltip-placement="bottom"
position="relative"
:width="96"
/>
<HuiFloatButton
shape="square"
icon="arrow-down"
description="bottom-start"
tooltip="bottom-start"
tooltip-placement="bottom-start"
position="relative"
:width="96"
/>
<HuiFloatButton
shape="square"
icon="arrow-down"
description="bottom-end"
tooltip="bottom-end"
tooltip-placement="bottom-end"
position="relative"
:width="96"
/>
</HuiSpace>
<HuiSpace wrap>
<HuiFloatButton
shape="square"
icon="arrow-left"
description="left"
tooltip="left"
tooltip-placement="left"
position="relative"
:width="96"
/>
<HuiFloatButton
shape="square"
icon="arrow-left"
description="left-start"
tooltip="left-start"
tooltip-placement="left-start"
position="relative"
:width="96"
/>
<HuiFloatButton
shape="square"
icon="arrow-left"
description="left-end"
tooltip="left-end"
tooltip-placement="left-end"
position="relative"
:width="96"
/>
<HuiFloatButton
shape="square"
icon="arrow-right"
description="right"
tooltip="right"
tooltip-placement="right"
position="relative"
:width="96"
/>
<HuiFloatButton
shape="square"
icon="arrow-right"
description="right-start"
tooltip="right-start"
tooltip-placement="right-start"
position="relative"
:width="96"
/>
<HuiFloatButton
shape="square"
icon="arrow-right"
description="right-end"
tooltip="right-end"
tooltip-placement="right-end"
position="relative"
:width="96"
/>
</HuiSpace>
</HuiSpace>
</template>
Descriptions and Dimensions
description is the small 12px text below the icon, usually used with shape="square". When a description is present, the icon shrinks from 20px to 16px. A 40px-wide button fits about two Chinese characters; longer text is ellipsized, so increase width as needed. width and height both default to 40; numbers are pixels and strings are used as provided. The button grows taller if its content requires more space. The description slot allows custom content and takes precedence over the prop.
Use the default slot for a custom icon or text. When the slot is provided, icon is not rendered.
<template>
<HuiSpace size="large" align="end">
<HuiFloatButton shape="square" icon="mail" description="Feedback" position="relative" />
<HuiFloatButton
shape="square"
icon="phone"
description="Phone support (truncated)"
position="relative"
/>
<HuiFloatButton
shape="square"
icon="phone"
description="Phone support"
:width="64"
:height="56"
position="relative"
/>
<HuiFloatButton shape="square" icon="user" width="4rem" height="4rem" position="relative">
<template #description>
<span style="color: var(--hui-color-primary)">Profile</span>
</template>
</HuiFloatButton>
<HuiFloatButton tooltip="AI assistant" position="relative">
<span style="font-weight: 600">AI</span>
</HuiFloatButton>
<HuiFloatButton
tooltip="Large button"
icon="plus"
type="primary"
:width="56"
:height="56"
position="relative"
/>
</HuiSpace>
</template>
Badges
badge displays an HuiBadge in the top-right corner:
- A number or string displays its content; numbers above 99 display
99+. true, or thebadgeattribute without a value, displays a dot.falseand0hide the badge. Pass the string'0'to display zero.
On circular buttons, the badge sits on the circumference at the upper-right 45° position. On square buttons, it aligns with the outer corner.
<script setup lang="ts">
import { ref } from 'vue'
import { HuiButton, HuiFloatButton, HuiSpace } from '@nscode/handy-ui'
const unread = ref(5)
</script>
<template>
<HuiSpace direction="vertical" align="start" size="large">
<HuiSpace size="large">
<HuiFloatButton icon="bell" tooltip="Notifications" :badge="unread" position="relative" />
<HuiFloatButton icon="user" tooltip="New activity" badge position="relative" />
<HuiFloatButton icon="mail" tooltip="99+" :badge="120" position="relative" />
<HuiFloatButton icon="star" tooltip="Text badge" badge="new" position="relative" />
<HuiFloatButton icon="file" tooltip="String '0'" badge="0" position="relative" />
<HuiFloatButton icon="folder" tooltip="Number 0 is hidden" :badge="0" position="relative" />
<HuiFloatButton
icon="bell"
shape="square"
tooltip="Square button"
:badge="unread"
position="relative"
/>
</HuiSpace>
<HuiSpace>
<HuiButton size="small" @click="unread++">Unread +1</HuiButton>
<HuiButton size="small" @click="unread = 0">Reset count (hidden at 0)</HuiButton>
</HuiSpace>
</HuiSpace>
</template>
Badges are hidden from screen readers and are not included in the button's accessible name. Include the count in aria-label when it needs to be announced, for example :aria-label="'Notifications, ' + unread + ' unread'".
Links
Providing href renders an <a>. With target="_blank", rel="noopener noreferrer" is added automatically unless an explicit rel is provided.
<template>
<HuiSpace size="large">
<HuiFloatButton
icon="link"
tooltip="User guide (opens in a new window)"
href="https://example.com/manual"
target="_blank"
position="relative"
/>
<HuiFloatButton
icon="download"
shape="square"
description="Download"
href="https://example.com/download"
target="_blank"
position="relative"
/>
</HuiSpace>
</template>
Expandable Menus
Place child HuiFloatButton components in the menu slot. They are arranged vertically above the main button. Click the main button to expand or collapse them; its icon changes to close while expanded.
menu-trigger="click"(the default): click to expand, then click again to collapse. Pressing the pointer elsewhere or moving focus away also closes the menu.menu-trigger="hover": pointer entry expands the menu; leaving closes it after 100ms. Moving onto a child button keeps it open. Clicking the main button also opens it for devices without hover, but does not close it.- Use
v-model:visibleto read and update the expanded state. - Clicking a child button does not close the menu. Set
visibletofalseto close it.
Child buttons are positioned by the menu, so they do not need position, right, or similar props. Their shape follows the main button when omitted. The left example opens on click; the right opens on hover and uses a square shape, which its children inherit:
<script setup lang="ts">
import { ref } from 'vue'
import { HuiFloatButton, HuiMessage } from '@nscode/handy-ui'
const open = ref(false)
const hoverOpen = ref(false)
const create = (kind: string) => {
open.value = false
HuiMessage.success(`Create ${kind}`)
}
</script>
<template>
<div class="stage">
<p class="state">
Click menu:{{ open ? 'Open' : 'Closed' }}; hover menu:{{ hoverOpen ? 'Open' : 'Closed' }}
</p>
<HuiFloatButton
v-model:visible="open"
type="primary"
icon="plus"
tooltip="Create"
menu-trigger="click"
position="absolute"
:left="40"
:bottom="24"
>
<template #menu>
<HuiFloatButton icon="file" tooltip="Create document" @click="create('document')" />
<HuiFloatButton icon="folder" tooltip="Create folder" @click="create('folder')" />
<HuiFloatButton icon="table" tooltip="Create table" @click="create('table')" />
</template>
</HuiFloatButton>
<HuiFloatButton
v-model:visible="hoverOpen"
shape="square"
icon="share"
tooltip="Share"
menu-trigger="hover"
position="absolute"
:left="120"
:bottom="24"
>
<template #menu>
<HuiFloatButton icon="mail" tooltip="Share by email" />
<HuiFloatButton icon="link" tooltip="Copy link" />
</template>
</HuiFloatButton>
</div>
</template>
<style scoped>
.stage {
position: relative;
height: 260px;
border: 1px dashed var(--hui-border-color);
border-radius: var(--hui-border-radius);
background-color: var(--hui-bg-color-page);
}
.state {
margin: 0;
padding: 12px 16px;
color: var(--hui-text-color-secondary);
}
</style>
Button Groups
HuiFloatButtonGroup arranges floating buttons vertically. The group controls positioning through position, left, right, top, and bottom, using the same rules as HuiFloatButton. Positioning props on individual buttons inside the group have no effect.
shape="circle"(the default): circular buttons with a 16px gap and individual shadows.shape="square": square buttons form one connected block with separators. The shadow and outer rounded corners belong to the group.
All buttons in the group follow its shape; an individual button's shape has no effect. The left group below uses circle, and the right uses square:
<script setup lang="ts">
import { HuiFloatButton, HuiFloatButtonGroup, HuiMessage } from '@nscode/handy-ui'
const notify = (text: string) => {
HuiMessage.info(text)
}
</script>
<template>
<div class="stage">
<HuiFloatButtonGroup position="absolute" :left="40" :bottom="24" aria-label="Quick actions">
<HuiFloatButton icon="help" tooltip="Help" @click="notify('Help')" />
<HuiFloatButton icon="mail" tooltip="Feedback" :badge="2" @click="notify('Feedback')" />
<HuiFloatButton icon="arrow-up" tooltip="Top" @click="notify('Back to top')" />
</HuiFloatButtonGroup>
<HuiFloatButtonGroup
position="absolute"
:left="120"
:bottom="24"
shape="square"
aria-label="Quick actions"
>
<HuiFloatButton icon="help" description="Help" @click="notify('Help')" />
<HuiFloatButton icon="mail" description="Feedback" :badge="2" @click="notify('Feedback')" />
<HuiFloatButton icon="arrow-up" description="Top" @click="notify('Back to top')" />
</HuiFloatButtonGroup>
</div>
</template>
<style scoped>
.stage {
position: relative;
height: 220px;
border: 1px dashed var(--hui-border-color);
border-radius: var(--hui-border-radius);
background-color: var(--hui-bg-color-page);
}
</style>
The group's root has role="group". Give it an accessible name with an attribute such as aria-label="Quick actions".
Combining with Back to Top
Use HuiBacktop for a standalone back-to-top button. It monitors scrolling and appears after visibility-height, with the same 40×40 circular shape, border, shadow, and icon size as HuiFloatButton. Offset separate buttons to avoid overlap, for example bottom: 40 for HuiBacktop and bottom: 96 for a floating button.
HuiBacktop uses its own fixed positioning and cannot be placed directly in HuiFloatButtonGroup: it would remain fixed to the viewport using its own right and bottom, rather than joining the group. For a grouped back-to-top action, use HuiFloatButton with icon="arrow-up" and track the scroll position yourself. Scroll the box below past 200px to reveal the action:
<script setup lang="ts">
import { ref } from 'vue'
import { HuiFloatButton, HuiFloatButtonGroup } from '@nscode/handy-ui'
const boxRef = ref<HTMLElement>()
const showTop = ref(false)
// For page scrolling, use window.scrollY and window.addEventListener('scroll', ...)
const update = () => {
showTop.value = (boxRef.value?.scrollTop ?? 0) >= 200
}
const toTop = () => boxRef.value?.scrollTo({ top: 0, behavior: 'smooth' })
</script>
<template>
<div class="stage">
<div ref="boxRef" class="box" @scroll="update">
<p v-for="i in 30" :key="i" class="line">Row {{ i }} content</p>
</div>
<HuiFloatButtonGroup position="absolute" :right="24" :bottom="16">
<HuiFloatButton icon="help" tooltip="Help" />
<HuiFloatButton v-if="showTop" icon="arrow-up" tooltip="Back to top" @click="toTop" />
</HuiFloatButtonGroup>
</div>
</template>
<style scoped>
.stage {
position: relative;
}
.box {
height: 240px;
overflow: auto;
padding: 0 16px;
border: 1px solid var(--hui-border-color);
border-radius: var(--hui-border-radius);
}
.line {
margin: 12px 0;
color: var(--hui-text-color-secondary);
}
</style>
Focus and Blur
Call focus() or blur() through the ref to focus or blur the main button. Focusing it shows its tooltip.
<script setup lang="ts">
import { ref } from 'vue'
import { HuiButton, HuiFloatButton, HuiSpace } from '@nscode/handy-ui'
const fabRef = ref<InstanceType<typeof HuiFloatButton>>()
</script>
<template>
<HuiSpace size="large">
<HuiButton @click="fabRef?.focus()">Focus</HuiButton>
<HuiButton @click="fabRef?.blur()">Blur</HuiButton>
<HuiFloatButton
ref="fabRef"
icon="setting"
tooltip="Show a tooltip on focus"
tooltip-placement="right"
position="relative"
/>
</HuiSpace>
</template>
Keyboard Interaction
- The main button is a native
<button>, or an<a>whenhrefis provided. Tab focuses it and displays the tooltip. Enter or Space activates a<button>; Enter activates an<a>. - With a menu, Enter or Space expands it and focuses the first child button; pressing again collapses it. ArrowUp on the main button opens the menu and focuses the nearest (bottommost) child; ArrowDown focuses the first child.
- Inside the menu, ArrowUp and ArrowDown move between child buttons with wrapping. Home and End go to the first and last buttons. Children do not have separate Tab stops; tabbing away closes the menu.
- Esc closes the menu and returns focus to the main button. Inside a modal or drawer, that Esc closes only the menu, leaving the surrounding overlay open.
Ancestor Size Variables and Explicit Props
Set --hui-float-button-width and --hui-float-button-height on the component or any ancestor. Dimensions resolve in this order: explicit width/height props → public variables → the original 40px defaults. Height remains a minimum, so descriptions can make the button taller. Numbers, CSS lengths, and numeric strings follow the existing conversion rules.
Below, the outer element sets 64px/52px and a nested element overrides them with 36px/36px. The middle button has its own 60px/56px variables plus explicit 48px/40px props; the props take precedence. Removing them restores its variables, and enabling them again restores the prop dimensions. Circular badges use the same resolved dimensions as the button and retain the 45° circumference-offset calculation. Menu children reset their private prop overrides so they do not inherit the main button's explicit dimensions. Existing group and menu positioning, shape, and interaction rules remain unchanged.
Set public variables on an ancestor class in the parent's <style scoped>; :deep() is not required.
<script setup lang="ts">
import { ref } from 'vue'
import { HuiFloatButton } from '@nscode/handy-ui'
const variableExplicit = ref(true)
const variableClicks = ref(0)
</script>
<template>
<div
class="float-button-variables-demo"
style="display:flex;flex-direction:column;gap:var(--hui-spacing-3);max-width:720px;--hui-float-button-width:64px;--hui-float-button-height:52px"
>
<button class="float-variable-toggle" @click="variableExplicit = !variableExplicit">
Explicit dimensions:{{ variableExplicit ? '48px/40px' : 'Not set' }}
</button>
<span class="float-variable-result">Clicks:{{ variableClicks }}</span>
<div
style="position:relative;height:200px;border:1px dashed var(--hui-border-color);margin-top:var(--hui-spacing-4)"
>
<HuiFloatButton
class="float-variable-inherited"
position="absolute"
:left="24"
:top="24"
icon="help"
aria-label="Ancestor-sized button"
:badge="3"
@click="variableClicks++"
/>
<HuiFloatButton
class="float-variable-explicit"
position="absolute"
:left="128"
:top="24"
:width="variableExplicit ? 48 : undefined"
:height="variableExplicit ? 40 : undefined"
icon="edit"
aria-label="Explicitly sized button"
style="--hui-float-button-width:60px;--hui-float-button-height:56px"
:badge="5"
@click="variableClicks++"
/>
<div
class="float-variable-nested"
style="--hui-float-button-width:36px;--hui-float-button-height:36px"
>
<HuiFloatButton
position="absolute"
:left="240"
:top="24"
icon="plus"
aria-label="Locally sized button"
@click="variableClicks++"
/>
</div>
</div>
</div>
</template>
Menu State and Public Methods
The menu uses visible, update:visible, open(), and close(). Supplying visible, including explicit undefined as closed, makes it controlled; without the prop, it keeps its own state. Requests wait for the actual parent value when controlled. These names replace showMenu and show-menu without aliases.
Expanded menus have one Tab stop. Up/Down and Home/End navigate available child actions; composition and modifier-key shortcuts are left alone. Closing restores focus to the main button when appropriate.
<script setup lang="ts">
import { ref } from 'vue'
import { HuiButton, HuiFloatButton, HuiSpace } from '@nscode/handy-ui'
import type { FloatButtonExpose } from '@nscode/handy-ui'
const menu = ref<FloatButtonExpose>()
const visible = ref(false)
const selected = ref('No action')
</script>
<template>
<HuiSpace direction="vertical" fill>
<HuiSpace
><HuiButton @click="menu?.open()">Open</HuiButton
><HuiButton @click="menu?.close()">Close</HuiButton></HuiSpace
>
<HuiFloatButton
ref="menu"
v-model:visible="visible"
position="relative"
icon="plus"
tooltip="More actions"
>
<template #menu
><HuiFloatButton icon="help" tooltip="Help" @click="selected = 'Help'" /><HuiFloatButton
icon="mail"
tooltip="Feedback"
@click="selected = 'Feedback'"
/></template>
</HuiFloatButton>
<span>Visible: {{ visible }}; selected: {{ selected }}</span>
</HuiSpace>
</template>
Props
FloatButton
| Prop | Type | Default | Description |
|---|---|---|---|
| icon | string | - | Icon name (see the Icons guide); use this or the default slot |
| tooltip | string | - | Tooltip on hover or focus; also the aria-label for an icon-only button |
| tooltip-placement | TooltipPlacement | 'left' | Tooltip placement |
| description | string | - | Small text below the icon, usually used with shape="square" |
| type | 'default' | 'primary' | 'default' | Type |
| shape | 'circle' | 'square' | - | Shape; defaults to circle. Inside a group it follows the group, ignoring its own value. Inside a menu it follows the main button when omitted |
| position | 'fixed' | 'absolute' | 'relative' | 'fixed' | Positioning. With fixed, z-index follows HuiConfigProvider.zIndex (2000 by default). Ignored inside a group or menu |
| left | number | string | - | Left offset; numbers are pixels. Ignored inside a group or menu |
| right | number | string | - | Right offset |
| top | number | string | - | Top offset |
| bottom | number | string | - | Bottom offset |
| width | number | string | 40 | Width |
| height | number | string | 40 | Minimum height; grows if needed to fit the content |
| badge | boolean | number | string | - | Top-right badge: true shows a dot; numbers above 99 show 99+; false and 0 hide it |
| href | string | - | Link destination; renders an <a> when provided. Ignored when there is a menu |
| target | string | - | Link target; _blank automatically adds rel="noopener noreferrer" |
| menu-trigger | 'click' | 'hover' | 'click' | Trigger for the expandable menu (menu slot) |
| visible | boolean | undefined | Menu state. Controlled whenever supplied, including undefined as closed; saved internally when omitted. |
class and style are applied to the root element for positioning. Other attributes (id, aria-label, data-*, and others) and undeclared event listeners are applied to the actual button.
FloatButtonGroup
| Prop | Type | Default | Description |
|---|---|---|---|
| shape | 'circle' | 'square' | 'circle' | Shape of the group's buttons; square forms a connected block |
| position | 'fixed' | 'absolute' | 'relative' | 'fixed' | Positioning. With fixed, z-index follows HuiConfigProvider.zIndex (2000 by default) |
| left | number | string | - | Left offset; numbers are pixels |
| right | number | string | - | Right offset |
| top | number | string | - | Top offset |
| bottom | number | string | - | Bottom offset |
Events
FloatButton
| Event | Callback arguments | Description |
|---|---|---|
| click | (event: MouseEvent) | Click on the main button; menu children emit their own click |
| update:visible | (value: boolean) | Menu expansion or collapse, used with v-model:visible |
FloatButtonGroup has no events.
Slots
FloatButton
| Slot | Description |
|---|---|
| default | Content in the icon position; replaces icon |
| description | Description content; takes precedence over the description prop |
| menu | Expandable child HuiFloatButton components; the main button can expand only when this slot exists |
FloatButtonGroup
| Slot | Description |
|---|---|
| default | The group's HuiFloatButton components |
Methods
FloatButton exposes the following through its ref:
| Method | Parameters | Description |
|---|---|---|
| focus | - | Focus the main button |
| blur | - | Blur the main button |
| open | - | Request opening; no operation without the menu slot. |
| close | - | Request closing the menu. |
FloatButtonGroup exposes no public methods.
The ref also exposes readonly visible, reflecting the actual parent value when controlled.
import type { FloatButtonExpose } from '@nscode/handy-ui'
interface FloatButtonExpose {
focus: () => void
blur: () => void
open: () => void
close: () => void
readonly visible: boolean
}
Types
import type {
FloatButtonProps,
FloatButtonEmits,
FloatButtonGroupProps,
FloatButtonShape,
FloatButtonType,
FloatButtonPosition,
FloatButtonMenuTrigger,
FloatButtonLength
} from '@nscode/handy-ui'
type FloatButtonShape = 'circle' | 'square'
type FloatButtonType = 'default' | 'primary'
type FloatButtonPosition = 'fixed' | 'absolute' | 'relative'
type FloatButtonMenuTrigger = 'click' | 'hover'
/** Numbers and numeric strings use pixels; other strings are used as provided */
type FloatButtonLength = number | string
interface FloatButtonProps {
left?: FloatButtonLength
right?: FloatButtonLength
top?: FloatButtonLength
bottom?: FloatButtonLength
width?: FloatButtonLength
height?: FloatButtonLength
position?: FloatButtonPosition
shape?: FloatButtonShape
type?: FloatButtonType
icon?: HuiIconName
description?: string
tooltip?: string
tooltipPlacement?: TooltipPlacement
href?: string
target?: string
badge?: boolean | number | string
menuTrigger?: FloatButtonMenuTrigger
visible?: boolean
}
interface FloatButtonEmits {
click: [event: MouseEvent]
'update:visible': [value: boolean]
}
interface FloatButtonGroupProps {
left?: FloatButtonLength
right?: FloatButtonLength
top?: FloatButtonLength
bottom?: FloatButtonLength
position?: FloatButtonPosition
shape?: FloatButtonShape
}