Participate in the WeaveFox "AI Artist" contest to win SEE Conf tickets and thousands of prizes

logoAnt Design X

DesignDevelopmentComponentsX MarkdownX SDKPlayground
  • Introduction
  • Overview
  • Common
    • Bubble
    • Conversations
    • Notification
  • Wake
    • Welcome
    • Prompts
  • Express
    • Attachments
    • Sender
    • Suggestion
  • Confirmation
    • Sources
    • Think
    • ThoughtChain
  • 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
itemsList containing multiple action items(ItemType | ReactNode)[]--
onClickCallback function when component is clickedfunction({ item, key, keyPath, domEvent })--
dropdownPropsConfiguration properties for dropdown menuDropdownProps--
variantVariantborderless | outlined |filledborderless-
fadeInFade in effectboolean--
fadeInLeftFade left in effectboolean--

ItemType

PropertyDescriptionTypeDefaultVersion
keyUnique identifier for custom actionstring--
labelDisplay label for custom actionstring--
iconIcon for custom actionReactNode--
onItemClickCallback function when custom action button is clicked(info: ItemType) => void--
dangerSyntactic sugar, sets danger 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 status 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 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 Templates

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
Fade In Effect

FadeIn.

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