Skip to content
This repository was archived by the owner on Sep 20, 2024. It is now read-only.

Commit 499d37b

Browse files
committed
feat: add custom styles examples
1 parent 850acca commit 499d37b

File tree

1 file changed

+88
-0
lines changed

1 file changed

+88
-0
lines changed
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
<script setup lang="ts">
2+
import { ref } from "vue"
3+
import { chakra, CStack, useColorModeValue } from "../../vue/src"
4+
import {
5+
CTabs,
6+
CTabList,
7+
CTab,
8+
CTabPanel,
9+
CTabPanels,
10+
CTabIndicator,
11+
} from "../src"
12+
13+
const value = ref("two")
14+
</script>
15+
16+
<template>
17+
<chakra.div data-testid="simple-tabs-example">
18+
<c-simple-grid template-rows="auto auto" gap="4">
19+
<c-stack
20+
spacing="5"
21+
rounded="8px"
22+
:border-color="
23+
useColorModeValue('blackAlpha.300', 'whiteAlpha.300').value
24+
"
25+
border-width="1px"
26+
border-style="solid"
27+
px="4"
28+
py="3"
29+
>
30+
<c-heading size="sm">With Indicator</c-heading>
31+
<c-tabs v-model="value" variant="unstyled">
32+
<c-tab-list>
33+
<c-tab value="one"> Item One </c-tab>
34+
<c-tab value="two"> Item Two </c-tab>
35+
<c-tab value="three"> Item Three </c-tab>
36+
</c-tab-list>
37+
<c-tab-indicator
38+
mt="-1.5px"
39+
height="2px"
40+
bg="pink.400"
41+
border-radius="1px"
42+
/>
43+
44+
<c-tab-panels>
45+
<c-tab-panel value="one"> Value Item 1 </c-tab-panel>
46+
<c-tab-panel value="two"> Value Item 2 </c-tab-panel>
47+
<c-tab-panel value="three"> Value Item 3 </c-tab-panel>
48+
</c-tab-panels>
49+
</c-tabs>
50+
</c-stack>
51+
<c-stack
52+
spacing="5"
53+
rounded="8px"
54+
:border-color="
55+
useColorModeValue('blackAlpha.300', 'whiteAlpha.300').value
56+
"
57+
border-width="1px"
58+
border-style="solid"
59+
px="4"
60+
py="3"
61+
>
62+
<c-heading size="sm">With Custom Style</c-heading>
63+
<c-tabs v-model="value" variant="unstyled">
64+
<c-tab-list>
65+
<c-tab :_selected="{ color: 'white', bg: 'blue.500' }" value="one">
66+
Item One
67+
</c-tab>
68+
<c-tab :_selected="{ color: 'white', bg: 'green.500' }" value="two">
69+
Item Two
70+
</c-tab>
71+
<c-tab
72+
:_selected="{ color: 'white', bg: 'orange.500' }"
73+
value="three"
74+
>
75+
Item Three
76+
</c-tab>
77+
</c-tab-list>
78+
79+
<c-tab-panels>
80+
<c-tab-panel value="one"> Value Item 1 </c-tab-panel>
81+
<c-tab-panel value="two"> Value Item 2 </c-tab-panel>
82+
<c-tab-panel value="three"> Value Item 3 </c-tab-panel>
83+
</c-tab-panels>
84+
</c-tabs>
85+
</c-stack>
86+
</c-simple-grid>
87+
</chakra.div>
88+
</template>

0 commit comments

Comments
 (0)