-
Notifications
You must be signed in to change notification settings - Fork 6.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: create tabs component #5964
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Looks good to me and it looks simple enough :)
(Gonna verify the UI changes now)
But I would also appreciate if you could add Unit Tests to verify that clicking on the Tabs changes the current tab
Also: PR needs to be rebased again
Based on the image above I feel that we need to support Tabs that instead of rendering a tab, they open an link/url. (External Link Tabs (which can also be internal links) So you have two types of tabs: type BaseTab = {
name: string;
label: React.ReactNode;
align?: 'left' | 'right'; // Allow to align the tab on the right or the left of the Tab Container
}
type ContentTab = BaseTab & {
content: React.ReactNode;
}
type LinkTab = BaseTab & {
link: string;
}
type Tab = (ContentTab | LinkTab)[]; Note that when the link is used we wrap the link with a Also when Link is used we render the "External Link" Icon as in the image. |
wdyt @bmuenzenmeyer is my comment above a correct interpretation of the Figma? |
my understanding is that the |
What I wonder how the Tabs panel and the button would coexist in the same place. Because either that button is floating or I don't know, as genuinely the content of the tabs and the tabs itself occupy one single container, so if the size of the tabs is reduced I assume the content is too... |
f884cf7
to
1d99d7e
Compare
Issue is on |
Description
Create Tabs component
Validation
Related Issues
Fixes #5817
Check List
npx turbo lint
to ensure the code follows the style guide. And runnpx turbo lint:fix
to fix the style errors if necessary.npx turbo format
to ensure the code follows the style guide.npx turbo test
to check if all tests are passing.