diff options
Diffstat (limited to 'src/ui/objects/Tab.tsx')
| -rw-r--r-- | src/ui/objects/Tab.tsx | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/ui/objects/Tab.tsx b/src/ui/objects/Tab.tsx new file mode 100644 index 0000000..15c1e5d --- /dev/null +++ b/src/ui/objects/Tab.tsx | |||
| @@ -0,0 +1,14 @@ | |||
| 1 | import type { HTMLAttributes } from "corvos/plugins/jsx.ts"; | ||
| 2 | |||
| 3 | export type Props = HTMLAttributes<"a"> & { | ||
| 4 | selected?: boolean; | ||
| 5 | }; | ||
| 6 | |||
| 7 | export const Tab = ({ selected, class: cls, ...props }: Props) => ( | ||
| 8 | <a | ||
| 9 | aria-selected={`${selected}`} | ||
| 10 | class:list={["o-tabbar__tab", { "is-selected": selected }, cls]} | ||
| 11 | role="tab" | ||
| 12 | {...props} | ||
| 13 | /> | ||
| 14 | ); | ||
