Raft 设计系统

组件 · 操作

FloatButton

Deprecated. A button that floats over the page content; actions belong in the page's header or toolbar instead.

已弃用也叫 FAB, Floating action button, FloatButtonGroup
import { FloatButton } from "@botiverse/raft-ui";
本页尚未翻译
译文完成之前,这里显示英文原文。 阅读英文版
已弃用
请改用 Panel。FloatButton 会在下一个主版本中移除。

FloatButton and FloatButtonGroup are deprecated and are removed in raft-ui 1.0. They are not part of the Raft Design System: in Raft, controls sit flat in the layout, and only menus, popups, dialogs and toasts float above the page (Elevation). Put the action in the page's header or toolbar instead: on desktop and on a phone's pushed page, that is PanelActions in the panel header (Panel).

The one kind of control that floats over content is the jump pill of a conversation, which takes the person somewhere in the message list instead of doing an action, and it is a Button without a shadow, not a FloatButton (Elevation).

When to use

SituationUse
An action for the whole page or panelA PanelAction in the panel header (Panel)
An action in a toolbar, such as New Task over a list of tasksThe toolbar's own button (Tasks)
Any other actionButton, in the layout
Back to Bottom, new messages, the next unread threadThe jump controls of MessageList

API

FloatButton

已弃用Not part of the Raft Design System; place actions in the page's header or toolbar. Removed in raft-ui 1.0.
Prop类型默认值
descriptionReactNode
iconReactNode
offsetFloatButtonOffset
positionFloatButtonPosition
shapeFloatButtonShape
sideFloatButtonSide
sizeFloatButtonSize
tooltipReactNode
variantFloatButtonVariant"default"
focusableWhenDisabledWhether the button should be focusable when disabled.booleanfalse
nativeButtonWhether the component renders a native `<button>` element when replacing it via the `render` prop. Set to `false` if the rendered element is not a button (for example, `<div>`).booleantrue
renderAllows you to replace the component's HTML element with a different tag, or compose it with another component.ReactElement | ((props, state) => ReactElement)

Also takes the attributes of its element.

FloatButtonGroup

已弃用Not part of the Raft Design System; place actions in the page's header or toolbar. Removed in raft-ui 1.0.
Prop类型默认值
attachedbooleanfalse
directionFloatButtonGroupDirection"vertical"
gapstring | number
offsetFloatButtonOffset
positionFloatButtonPosition
shapeFloatButtonShape"circle"
sideFloatButtonSide
sizeFloatButtonSize
renderAllows you to replace the component's HTML element with a different tag, or compose it with another component.ReactElement | ((props, state) => ReactElement)

Also takes the attributes of its element.

改动

  • 0.7.0 · ChangedDeprecated, to be removed in 1.0: FloatButton / FloatButtonGroup (not part of the design system), LegacyTaskPanel* (unused), and LiveAgentActivityBar* (the design system shows working agents where they appear).