logoAnt Design X

DesignDevelopmentComponentsX MarkdownX SDKPlayground
  • Introduction
  • Overview
  • Common
    • Bubble
    • Conversations
    • Notification
  • Confirmation
    • Sources
    • Think
    • ThoughtChain
  • Wake
    • Welcome
    • Prompts
  • Express
    • Attachments
    • Sender
    • Suggestion
  • Feedback
    • Actions
    • FileCard
  • Others
    • XProvider

Actions

Used for quickly configuring required action buttons or features in some AI scenarios.
Importimport { Actions } from "@ant-design/x";
Sourcecomponents/actions
Docs
Edit this page...
loading

When to Use

The Actions component is used for quickly configuring required action buttons or features in some AI scenarios.

Examples

API

Common props ref:Common props

ActionsProps

PropertyDescriptionTypeDefaultVersion
itemsA list containing multiple action items(ItemType | ReactNode)[]--
onClickCallback function when an action item is clickedfunction({ item, key, keyPath, domEvent })--
dropdownPropsConfiguration properties for dropdown menuDropdownProps--
variantVariantborderless | outlined |filledborderless-

ItemType

PropertyDescriptionTypeDefaultVersion
keyThe unique identifier for the custom actionstring--
labelThe display label for the custom actionstring--
iconThe icon for the custom actionReactNode--
onItemClickCallback function when the custom action button is clicked(info: ItemType) => void--
dangerSyntax sugar, set dangerous iconbooleanfalse-
subItemsSub action itemsOmit<ItemType, 'subItems' | 'triggerSubMenuAction' | 'actionRender'>[]--
triggerSubMenuActionAction to trigger the sub-menuhover | clickhover-
actionRenderCustom render action item content(item: ItemType) => ReactNode--

Actions.Feedback

PropertyDescriptionTypeDefaultVersion
valueFeedback valuelike | dislike | defaultdefault-
onChangeFeedback status change callback(value: like | dislike | default) => void--

Actions.Copy

PropertyDescriptionTypeDefaultVersion
textText to be copiedstring''-
iconCopy buttonReact.ReactNode--

Actions.Audio

PropertyDescriptionTypeDefaultVersion
statusPlayback status'loading'|'error'|'running'|'default'default-

Actions.Item

PropertyDescriptionTypeDefaultVersion
statusStatus'loading'|'error'|'running'|'default'default-
labelDisplay label for the custom actionstring--
defaultIconDefault status iconReact.ReactNode--
runningIconRunning status iconReact.ReactNode--

Semantic DOM

Design Token

Global TokenHow to use?
Changelog
Basic

Basic usage.

CodeSandbox Icon
codepen icon
External Link Icon
expand codeexpand code
More Menu Items

Display more menu items by setting the subItems property. Items with subItems don't need to configure an icon; <EllipsisOutlined /> will be used by default.

CodeSandbox Icon
codepen icon
External Link Icon
expand codeexpand code
Preset Template

For some commonly used functions, preset components can be used to quickly build them.

CodeSandbox Icon
codepen icon
External Link Icon
expand codeexpand code
Using Variants

Use variant to switch variants.

CodeSandbox Icon
codepen icon
External Link Icon
expand codeexpand code
  • /5
  • /5
  • /5
  • /5
  • root
    Root
  • item
    Item
  • itemDropdown
    Item Dropdown