2.10.0
中文
Skip to content

XProvider ​

Provides unified global configuration for components.

Usage notes ​

XProvider inherits from antdv's ConfigProvider and provides global configuration for components in ant-design-x-vue.

If you are already using antdv's ConfigProvider, please make the following changes to your code:

diff
- import { ConfigProvider } from 'ant-design-vue';
+ import { XProvider } from 'ant-design-x-vue';

  const App = () => (
-   <ConfigProvider>
+   <XProvider>
      <YourApp />
-   </ConfigProvider>
+   </XProvider>
  );

Examples ​

Direction ​

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
Direction

Here lists the components that support rtl direction, and you can switch directions in the demo.

Theme ​

ColorPrimary:文字颜色:
  • Conversation - 1
  • Conversation - 2
Do you want?
Hot Topics

What are you interested in?

Design Guide

How to design a good product?

Start Creating

How to start a new project?

Theme

Modify the theme through theme.

Internationalization ​

Change locale of components:
  • 帮我写作
  • AI编码
  • 图片生成
  • 深度搜索
Internationalization

Switch component text through locale. You can merge the language packs of ant-design-vue with ant-design-x-vue's zh_CN / en_US and pass it in.

Keyboard shortcuts ​

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

Set shortcut keys through shortcutKeys.

API ​

XProvider fully inherits from antdv's ConfigProvider. Refer to properties here: Antdv ConfigProvider

Components Configuration ​

PropDescriptionTypeDefaultVersion
actionsGlobal configuration for the action list componentComponentStyleConfig--
attachmentsGlobal configuration for the attachment input componentComponentStyleConfig--
bubbleGlobal configuration for the bubble componentComponentStyleConfig--
conversationsGlobal configuration for the conversation componentComponentStyleConfig &--
fileCardGlobal configuration for the file card componentComponentStyleConfig--
promptsGlobal configuration for the prompts componentComponentStyleConfig--
senderGlobal configuration for the input box componentComponentStyleConfig--
sourcesGlobal configuration for the references componentComponentStyleConfig--
suggestionGlobal configuration for the suggestion componentComponentStyleConfig--
thinkGlobal configuration for the thinking componentComponentStyleConfig--
thoughtChainGlobal configuration for the thought chain componentComponentStyleConfig--
welcomeGlobal configuration for the welcome componentComponentStyleConfig--

Markdown component configuration ​

PropDescriptionTypeDefaultVersion
highlightCodeGlobal configuration for the code highlighting componentComponentStyleConfig--
mermaidGlobal configuration for the Mermaid chart componentComponentStyleConfig--

ComponentStyleConfig ​

ts
interface ComponentStyleConfig {
  style: CSSProperties;
  styles: Record<string, CSSProperties>;
  className: string;
  classNames: Record<string, string>;
}

ShortcutKeys ​

ts
type PrefixKeysType = {
  Ctrl: [keyof KeyboardEvent, string, string];
  Alt: [keyof KeyboardEvent, string, string];
  Meta: [keyof KeyboardEvent, string, string];
  Shift: [keyof KeyboardEvent, string, string];
};

type ShortcutKeys<CustomKey = number | 'number'> =
  | [keyof PrefixKeysType, keyof PrefixKeysType, CustomKey]
  | [keyof PrefixKeysType, CustomKey];

Design Token ​

XProvider itself does not provide independent Component Tokens; please configure global Tokens and individual Component Tokens through theme.

Contributors ​

Contributors

Loading contributors…