Skip to content

Commit 8c9e89f

Browse files
Karthik-B-06kodiakhq[bot]
authored andcommitted
chore(example-app): ✨ create Tag component screen with examples
1 parent f503c9b commit 8c9e89f

File tree

3 files changed

+61
-0
lines changed

3 files changed

+61
-0
lines changed

example/src/AppRoot.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import {
99
CheckboxScreen,
1010
MeterComponentScreen,
1111
SpinnerScreen,
12+
TagScreen,
1213
TooltipScreen,
1314
} from "./modules";
1415

@@ -57,6 +58,11 @@ const AppRoot = () => {
5758
name="TooltipScreen"
5859
component={TooltipScreen}
5960
/>
61+
<Drawer.Screen
62+
options={{ title: "TagScreen" }}
63+
name="TagScreen"
64+
component={TagScreen}
65+
/>
6066
</Drawer.Navigator>
6167
);
6268
};
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
import React from "react";
2+
import {
3+
Box,
4+
CaretRight,
5+
Icon,
6+
Info,
7+
Tag,
8+
useTheme,
9+
} from "@adaptui/react-native-tailwind";
10+
11+
export const TagScreen = () => {
12+
const tailwind = useTheme();
13+
return (
14+
<Box
15+
style={tailwind.style("flex-1 justify-center items-center bg-white-900")}
16+
>
17+
<Tag style={tailwind.style("my-1")}>Default</Tag>
18+
<Tag
19+
style={tailwind.style("my-1")}
20+
prefix={<Icon icon={<Info />} />}
21+
variant="outline"
22+
>
23+
Default Outline
24+
</Tag>
25+
<Tag style={tailwind.style("my-1")} variant="subtle">
26+
Default Subtle
27+
</Tag>
28+
<Tag style={tailwind.style("my-1")} themeColor="primary">
29+
Primary Solid
30+
</Tag>
31+
32+
<Tag
33+
prefix={<Icon icon={<Info />} />}
34+
style={tailwind.style("my-1")}
35+
themeColor="primary"
36+
variant="outline"
37+
>
38+
Primary Outline
39+
</Tag>
40+
<Tag
41+
suffix={<Icon icon={<CaretRight />} />}
42+
style={tailwind.style("my-1")}
43+
themeColor="primary"
44+
variant="subtle"
45+
closable
46+
>
47+
Primary Subtle
48+
</Tag>
49+
<Tag closable style={tailwind.style("my-1")} themeColor="primary">
50+
Close
51+
</Tag>
52+
</Box>
53+
);
54+
};

example/src/modules/primitives/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ export * from "./ButtonScreen";
55
export * from "./CheckboxScreen";
66
export * from "./MeterComponentScreen";
77
export * from "./SpinnerScreen";
8+
export * from "./TagScreen";

0 commit comments

Comments
 (0)