跳转到内容
搜索文档

RtkText

最后更新 查看 MarkdownAgent 设置

应用了设计系统的颜色、字体族和字体大小的主题化文本组件。

属性

属性 类型 必填 默认值 描述
children ReactNode - 文本内容
size 'sm' | 'md' | 'lg' | 'xl' 'md' 字体大小(sm=14, md=16, lg=18, xl=20)
fontWeight 'normal' | 'bold' | '100' | '200' | '300' | '400' | '500' | '600' | '700' | '800' | '900' 'normal' 字重
style StyleProp<TextStyle> \{\} 自定义文本样式
onBrand boolean false 使用品牌文本颜色而不是默认文本颜色

使用示例

基本用法

import { RtkText } from "@cloudflare/realtimekit-react-native-ui";

function MyComponent() {
	return <RtkText>Hello World</RtkText>;
}

带有属性

import { RtkText } from "@cloudflare/realtimekit-react-native-ui";

function MyComponent() {
	return (
		<RtkText size="lg" fontWeight="bold" onBrand={true}>
			Meeting Title
		</RtkText>
	);
}

这篇文档对您有帮助吗?