logoAnt Design X

设计研发组件演示
  • 总览
  • 通用
    • Bubble对话气泡
    • Conversations管理对话
  • 唤醒
    • Welcome欢迎
    • Prompts提示集
  • 表达
    • Attachments输入附件
    • Sender输入框
    • Suggestion快捷指令
  • 确认
    • ThoughtChain思维链
  • 工具
    • useXAgent模型调度
    • useXChat数据管理
    • XStream流
    • XRequest请求
    • XProvider全局化配置

XProvider
全局化配置

为组件提供统一的全局化配置。
使用import { XProvider } from "@ant-design/x";
源码components/x-provider
文档
编辑此页更新日志

相关资源

Ant Design
Ant Design Charts
Ant Design Pro
Pro Components
Ant Design Mobile
Ant Design Mini
Ant Design Web3
Ant Design Landing-首页模板集
Scaffolds-脚手架市场
Umi-React 应用开发框架
dumi-组件/文档研发工具
qiankun-微前端框架
Ant Motion-设计动效
国内镜像站点 🇨🇳

社区

Awesome Ant Design
Medium
Twitter
yuque logoAnt Design 语雀专栏
Ant Design 知乎专栏
体验科技专栏
seeconf logoSEE Conf-蚂蚁体验科技大会
加入我们

帮助

GitHub
更新日志
常见问题
报告 Bug
议题
讨论区
StackOverflow
SegmentFault

Ant XTech logo更多产品

yuque logo语雀-构建你的数字花园
AntV logoAntV-数据可视化解决方案
Egg logoEgg-企业级 Node.js 框架
Kitchen logoKitchen-Sketch 工具集
Galacean logoGalacean-互动图形解决方案
xtech logo蚂蚁体验科技
主题编辑器
Made with ❤ by
蚂蚁集团和 Ant Design 开源社区
loading

使用说明

XProvider 继承了 antd 的 ConfigProvider,且为 @ant-design/x 中的组件提供全局化配置。

如果您已经使用 antd 的 ConfigProvider,请对您的代码做如下变更:

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

代码演示

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
使用

如何使用

CodeSandbox Icon
codepen icon
External Link Icon
expand codeexpand code

API

XProvider 完全继承 antd 的 ConfigProvider, 属性参考:Antd ConfigProvider

组件配置

属性说明类型默认值版本
bubble气泡组件的全局配置'classNames' | 'styles' | 'className' | 'style'-
conversations会话组件的全局配置'classNames' | 'styles' | 'className' | 'style'-
prompts提示集组件的全局配置'classNames' | 'styles' | 'className' | 'style'-
sender输入框组件的全局配置'classNames' | 'styles' | 'className' | 'style'-
suggestion建议组件的全局配置'className' | 'style'-
thoughtChain思维链组件的全局配置'classNames' | 'styles' | 'className' | 'style'-