2.10.0
中文
Skip to content

Actions ​

Used to quickly configure action buttons/functions required in some AI scenarios.

When to use ​

The Actions component is used to quickly configure action buttons/functions required in some AI scenarios.

Examples ​

Basic ​

More menu items ​

Preset templates ​

Variants ​

Fade-in effect ​

Mobile behavior: internally uses useMobile for SSR-safe device detection. On mobile devices, action items and Actions.Feedback no longer render tooltips (to prevent click-through), and items with submenus default to being triggered by click (can still be overridden via triggerSubMenuAction).

useMobile can also be imported directly from ant-design-x-vue.

ts
import { useMobile } from 'ant-design-x-vue';

const isMobile = useMobile(); // Ref<boolean>,服务端与首屏为 false,挂载后更新

API ​

General properties reference: General Properties.

ActionsProps ​

PropDescriptionTypeDefaultVersion
itemsList containing multiple action itemsItemType[]--
onClickCallback function when the component is clickedfunction({ item, key, keyPath, domEvent })--
dropdownPropsConfiguration properties of the dropdown menuDropdownProps--
variantVariantborderless | outlined | filledborderless-
fadeInEnable fade-in on renderboolean--
fadeInLeftEnable left-to-right fade-inboolean--
rootClassNameRoot class namestring--
classNameOuter classNamestring--
styleRoot styleCSSProperties--
classNamesSemantic class namesRecord<SemanticType, string>--
stylesSemantic stylesRecord<SemanticType, CSSProperties>--
prefixClsClass name prefixstring--

block is deprecated, please use variant.

ItemType ​

PropDescriptionTypeDefaultVersion
keyUnique identifier for the custom actionstring--
labelDisplay label for the custom actionstring--
iconIcon for the custom actionVNodeChild--
onItemClickCallback when the custom action button is clicked(info?: ItemType) => void--
dangerSyntactic sugar to set a dangerous stylebooleanfalse-
subItemsSub-action itemsOmit< ItemType, 'subItems''triggerSubMenuAction''actionRender'>[]
triggerSubMenuActionAction to trigger the sub-menu. Defaults to hover on desktop and click on mobilehoverclickDesktop hover / Mobile click
actionRenderCustom render content for the action item((item: ItemType) => VNodeChild)VNodeChild-

Actions.Feedback ​

PropDescriptionTypeDefaultVersion
valueFeedback status valuelikedislikedefault
onChangeCallback for feedback status change(value: likedislikedefault) => void

Actions.Copy ​

PropDescriptionTypeDefaultVersion
textText to be copiedstring''-
iconCopy button iconVNodeChild--

Actions.Audio ​

PropDescriptionTypeDefaultVersion
statusPlayback statusloading | error | running | defaultdefault-

Actions.Item ​

PropDescriptionTypeDefaultVersion
statusStatusloading | error | running | defaultdefault-
labelDisplay label for the custom actionstring--
defaultIconDefault state iconVNodeChild--
runningIconRunning state iconVNodeChild--

Semantic DOM ​

  • root
    根节点
  • item
    操作项
  • itemDropdown
    操作下拉选项

Actions.Feedback also supports semantic structure: root / like / liked / dislike / disliked. Actions.Copy / Actions.Audio / Actions.Item currently only expose root-level style properties, with no additional semantic slots.

Design Token ​

This component has no custom Component Token. Customize it through global Design Tokens.

Contributors ​

Contributors

Loading contributors…