FloatButton
Floating action buttons for quick access to common actions, with group and back-to-top support.
When to Use
- To provide quick access to frequently used actions (e.g., help, feedback)
- As a floating back-to-top button for long pages
- To group multiple floating actions that expand on click or hover
Import
Examples
Basic
A simple floating action button.
Shapes
FloatButton supports circle (default) and square shapes.
With Tooltip
Show a tooltip on hover with the tooltip prop.
With Badge
Display a notification badge with a count or dot indicator.
Group
Group multiple floating buttons that expand on click or hover.
Back to Top
A specialized button that scrolls to the top of the page when clicked.
Note
FloatButton.BackTop is visibility-based — it only appears after scrolling past the visibilityHeight threshold. It is best demonstrated in a full-page context rather than a preview.
API
FloatButtonProps
icon—ReactNode— Button icontype—"primary" | "default"— Visual style (default:"default")shape—"circle" | "square"— Button shape (default:"circle")description—ReactNode— Text below the icontooltip—string— Hover tooltip textbadge—{ count?: number; dot?: boolean }— Badge indicatorhref—string— Navigate to URL on clickonClick—() => void— Click handler
FloatButton.Group Props
trigger—"click" | "hover"— How the group expandsopen—boolean— Controlled open stateonOpenChange—(open: boolean) => void— Open state callbackicon—ReactNode— Icon for the trigger buttonshape—"circle" | "square"— Shape for all buttons (default:"circle")
FloatButton.BackTop Props
visibilityHeight—number— Scroll distance before showing (default:400)duration—number— Scroll animation duration in ms (default:450)- Inherits all FloatButtonProps