@unif/react-native-chat-markdown
v0.4.1
Published
UNIF React Native Chat Markdown — Markdown 渲染、ThinkBlock、流式气泡
Readme
@unif/react-native-chat-markdown
Markdown 渲染组件库 — 提供统一的 Markdown 渲染组件。
安装
yarn add @unif/react-native-chat-markdownpeerDependencies
yarn add react react-native @ronradtke/react-native-markdown-display组件
Markdown
Markdown 渲染组件,支持自定义样式。
import {Markdown} from '@unif/react-native-chat-markdown';
<Markdown text="**加粗** 和 `代码`" />| 属性 | 类型 | 说明 |
|------|------|------|
| text | string | Markdown 文本 |
| markdownStyles | MarkdownStyles | 覆盖默认样式 |
| style | ViewStyle | 容器样式 |
| testID | string | 测试标识 |
MarkdownStyles
支持的样式键:body、paragraph、code_inline、fence、link、strong、list_item、blockquote、heading1~heading6、bullet_list、ordered_list、hr、image、table、thead、tbody、tr、th、td。
注意事项
Think(思考折叠块)、parseThinkTags(标签解析)已迁移到@unif/react-native-chat包导出- 流式打字光标由
Bubble的typingprop 提供,不再需要独立的流式组件
兼容性
| @unif/react-native-chat-markdown | React Native | React | 状态 | |----------------------------------|-------------|-------|------| | 0.3.x | >= 0.71 | >= 18 | ✅ | | 0.3.x | 0.74.x | 18.x | ✅ 已验证(PECPortal) |
许可证
MIT
