import { Icon } from '@roninoss/icons';
import { Stack } from 'expo-router';
import { View, ScrollView, Pressable } from 'react-native';
import { Text } from '~/components/nativewindui/Text';
import { useColorScheme } from '~/lib/useColorScheme';
export default function TextScreen() {
const { colors } = useColorScheme();
return (
<>
<Stack.Screen
options={{
title: 'NativeWindUI',
headerSearchBarOptions: {
hideWhenScrolling: false,
},
headerLargeTitle: true,
headerRight() {
return (
<Pressable className="opacity-80 active:opacity-40">
<View className="opacity-90">
<Icon name="cog-outline" color={colors.foreground} />
</View>
</Pressable>
);
},
}}
/>
<ScrollView contentInsetAdjustmentBehavior="automatic" className="p-4">
<View className="border-border bg-card gap-4 rounded-xl border p-4 pb-6 shadow-sm shadow-black/10 dark:shadow-none">
<Text className="text-foreground text-center text-sm font-medium tracking-wider opacity-60">
Text
</Text>
<View className="gap-2">
<Text variant="largeTitle" className="text-center">
Large Title
</Text>
<Text variant="title1" className="text-center">
Title 1
</Text>
<Text variant="title2" className="text-center">
Title 2
</Text>
<Text variant="title3" className="text-center">
Title 3
</Text>
<Text variant="heading" className="text-center">
Heading
</Text>
<Text variant="body" className="text-center">
Body
</Text>
<Text variant="callout" className="text-center">
Callout
</Text>
<Text variant="subhead" className="text-center">
Subhead
</Text>
<Text variant="footnote" className="text-center">
Footnote
</Text>
<Text variant="caption1" className="text-center">
Caption 1
</Text>
<Text variant="caption2" className="text-center">
Caption 2
</Text>
</View>
</View>
</ScrollView>
</>
);
}
npx nwui-cli@latest add text
npx expo install react-native-uitextview
import { Text } from '~/components/nativewindui/Text';
<Text>Body</Text>
Text
Inherits all the props from bluesky-social's react-native-uitextview
Prop | Type | Default | Description |
---|---|---|---|
variant | "largeTitle" | "title1" | "title2" | "title3" | "heading" | "body" | "callout" | "subhead" | "footnote" | "caption1" | "caption2" | body | Defines the text style variant. |
color | "primary" | "secondary" | "tertiary" | "quarternary" | primary | Defines the text color. |
TextClassContext
: A context that provides a class name to its Text
children.