Possible to use Tab component as navigation links? #517
-
Hi! I've noticed on the Vercel dashboard page that the tab component is used to navigate between dashboard views. Is it possible to use the Geist UI component to achieve this same effect? (Make each tab a link) |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 5 replies
-
This requires that the |
Beta Was this translation helpful? Give feedback.
-
Hi @matgurney, if you are using Next.js it might help you: import React from 'react';
import { Tabs } from '@geist-ui/react';
import { useRouter } from 'next/router';
const Menu = () => {
const router = useRouter();
return (
<Tabs value={router.pathname} onChange={(route) => router.push(route)}>
<Tabs.Item label="Overview" value="/" />
<Tabs.Item label="Projects" value="/projects" />
<Tabs.Item label="Integrations" value="/integrations" />
<Tabs.Item label="Activity" value="/activity" />
<Tabs.Item label="Domains" value="/domains" />
<Tabs.Item label="Usage" value="/usage" />
<Tabs.Item label="Settings" value="/settings" />
</Tabs>
);
};
export default Menu; |
Beta Was this translation helpful? Give feedback.
This requires that the
label
prop be able to accept thejsx.element
, but this will also have an effect on the default value ofvalue
(the default selected link will also be strange), this feature should not be implemented anytime soon.