logoAnt Design X

DesignDevelopmentComponentsX SDKX MarkdownPlayground
  • Overview
  • Common
    • Actions
    • Bubble
    • Conversations
  • Wake
    • Welcome
    • Prompts
  • Express
    • Attachments
    • Sender
    • Suggestion
  • Confirm
    • ThoughtChain
  • Tools
    • useXAgent
    • useXChat
    • XStream
    • XRequest
    • XProvider

XProvider

Provide a uniform configuration support for x components.
Importimport { XProvider } from "@ant-design/x";
Sourcecomponents/x-provider
Docs
Edit this pageChangelog

Resources

Ant Design
Ant Design Charts
Ant Design Pro
Pro Components
Ant Design Mobile
Ant Design Mini
Ant Design Web3
Ant Design Landing-Landing Templates
Scaffolds-Scaffold Market
Umi-React Application Framework
dumi-Component doc generator
qiankun-Micro-Frontends Framework
Ant Motion-Motion Solution
China Mirror 🇨🇳

Community

Awesome Ant Design
Medium
Twitter
yuque logoAnt Design in YuQue
Ant Design in Zhihu
Experience Cloud Blog
seeconf logoSEE Conf-Experience Tech Conference

Help

GitHub
Change Log
FAQ
Bug Report
Issues
Discussions
StackOverflow
SegmentFault

Ant XTech logoMore Products

yuque logoYuQue-Document Collaboration Platform
AntV logoAntV-Data Visualization
Egg logoEgg-Enterprise Node.js Framework
Kitchen logoKitchen-Sketch Toolkit
Galacean logoGalacean-Interactive Graphics Solution
xtech logoAnt Financial Experience Tech
Theme Editor
Made with ❤ by
Ant Group and Ant Design Community

Use

The XProvider extends the ConfigProvider from antd and provides global configuration for components in @ant-design/x.

If you are already using ConfigProvider from antd, please make the following changes to your code:

diff
- import { ConfigProvider } from 'antd';
+ import { XProvider } from '@ant-design/x';
const App = () => (
- <ConfigProvider>
+ <XProvider>
<YourApp />
- </ConfigProvider>
+ </XProvider>
);

Examples

API

XProvider fully extends antd's ConfigProvider. Props ref:Antd ConfigProvider

Component Config

PropertyDescriptionTypeDefaultVersion
bubbleGlobal configuration for the Bubble component{style: React.CSSProperties; styles: Record<string, React.CSSProperties>;className: string; classNames: Record<string, string>;}--
conversationsGlobal configuration for the Conversations component{style: React.CSSProperties; styles: Record<string, React.CSSProperties>;className: string; classNames: Record<string, string>;shortcutKeys: {items?: ShortcutKeys<'number'> | ShortcutKeys[]}}--
promptsGlobal configuration for the Prompts component{style: React.CSSProperties; styles: Record<string, React.CSSProperties>;className: string; classNames: Record<string, string>;}--
senderGlobal configuration for the Sender component{style: React.CSSProperties; styles: Record<string, React.CSSProperties>;className: string; classNames: Record<string, string>;}--
suggestionGlobal configuration for the Suggestion component{style: React.CSSProperties; className: string;}-
thoughtChainGlobal configuration for the ThoughtChain component{style: React.CSSProperties; styles: Record<string, React.CSSProperties>;className: string; classNames: Record<string, string>;}-
actionsGlobal configuration for the Actions component{style: React.CSSProperties; className: string;}-

ShortcutKeys

ts
type SignKeysType = {
Ctrl: keyof KeyboardEvent;
Alt: keyof KeyboardEvent;
Meta: keyof KeyboardEvent;
Shift: keyof KeyboardEvent;
};
type ShortcutKeys<CustomKey = number | 'number'> =
| [keyof SignKeysType, keyof SignKeysType, CustomKey]
| [keyof SignKeysType, CustomKey];
Direction

Components which support rtl direction are listed here, you can toggle the direction in the demo.

CodeSandbox Icon
codepen icon
External Link Icon
expand codeexpand code
Theme

Modify theme by theme prop.

CodeSandbox Icon
codepen icon
External Link Icon
expand codeexpand code
Shortcut Key

Modify shortcut keys by shortcutKeys prop.

CodeSandbox Icon
codepen icon
External Link Icon
expand codeexpand code
Direction:
  • Conversation - 1
  • Conversation - 2
Hello Ant Design X!
Hello World!
Ignite Your Creativity
Tell me a Joke
Hello Ant Design X!status: success
Ant Design X help you build AI chat/platform app as ready-to-use 📦.
Hello World!status: success
Pending...status: pending
ColorPrimary:
  • Conversation - 1
  • Conversation - 2
Do you want?
Hot Topics

What are you interested in?

What's new in X?

What's AGI?

Where is the doc?

Design Guide

How to design a good product?

Know the well

Set the AI role

Express the feeling

Start Creating

How to start a new project?

Fast Start

Install Ant Design X

Online Playground

Play on the web without installing

You can switch sessions using the shortcut key: Alt/⌥ + number
  • Help Me Write
  • AI Coding
  • Create Image
  • Deep Search