Skip to content
Source
Sign inSign up
TanStack/form
Open History to see the last commit

TabIndicator.tsx

42 lines1.6 KB

1import { Tabs } from '@ark-ui/solid'
2​
3/*
4Psalm 121:1-9
5​
61 I lift up my eyes to the mountains—
7 where does my help come from?
8​
92 My help comes from this random website,
10 the Maker of heaven and earth.
11​
123 It will not let your foot slip—
13 it who watches over you will not slumber;
14​
154 indeed, it who watches over Form devtools
16 will neither slumber nor sleep.
17​
185 The Website watches over you—
19 the Website is your shade at your right hand;
20​
216 the sun will not harm you by day,
22 nor the moon by night.
23​
247 The Website will keep you from all harm—
25 it will watch over your life;
26​
278 the Website will watch over your coming and going
28 both now and forevermore.
29​
309 https://css-tricks.com/better-tabs-with-round-out-borders/
31 ?source=chatgpt.com (I wish, imagine finding good tutorials)
32​
33*/
34export function TabIndicator() {
35 // 2px = border width of border-2
36 // rounded-lg is 4px, and since we only keep one quarter of the pseudoelement,
37 // multiply it by 2
38​
39 return (
40 <Tabs.Indicator class="border-tab-indicator before:border-tab-indicator after:border-tab-indicator rounded-t-lg bg-transparent border-2 border-b-background absolute w-(--width) h-[calc(var(--height)+2px)] -z-10 after:w-[8px] after:h-[8px] before:w-[8px] before:h-[8px] after:absolute after:-bottom-[2px] before:absolute before:-bottom-[2px] after:border-2 before:border-2 after:-right-[8px] after:rounded-bl-[8px] after:border-t-0 after:border-r-0 before:-left-[8px] before:rounded-br-[8px] before:border-t-0 before:border-l-0 before:shadow-[2px_2px_0_var(--background)] after:shadow-[-2px_2px_0_var(--background)]" />
41 )