-
Notifications
You must be signed in to change notification settings - Fork 41
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 code switcher tab #8
feat: create code switcher tab #8
Conversation
Visit the preview URL for this PR (updated for commit 40708ac): https://zksync-docs-staging-5eb09--pr8-itsacoyote-devrl-448-blokitwu.web.app (expires Mon, 08 Apr 2024 15:44:12 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 Sign: bfaafba5fa82d4f63473aaa76a21fabf1fbb3a11 |
e52be8e
to
678de53
Compare
@@ -0,0 +1,37 @@ | |||
<script setup lang="ts"> | |||
defineProps<{ | |||
items: CodeSwitcherTabItem[]; |
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.
Nit: Can we update the name. CodeSwitcher seems to focused on code whereas its more like a content swticher. Thoughts?
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.
Sounds good to me, I'll rename 👍🏻
label: 'HardHat', | ||
partial: '_getting-started/_aPartial' | ||
}, { | ||
label: 'Forge', | ||
partial: '_getting-started/_anotherpartial' |
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.
This is perfect, being able to specify dedicated pages for each partial 💯
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.
Just the one comment on name change from CodeSwitcher to something along the lines of ContentSwitcher.
What 💻
Why ✋
Evidence 📷
Example set up in the Getting Started page to show how it can be used.
NuxtUI has a UTabs component that can be used plainly if we didn't want to use this. This new component provides a way to have tabbed content that can be loaded from partial markdown files to help split up content and make editing potentially easier.
A future feature to implement in this component would be to have a way to track which tab is actively selected and update similar tabs to the same selected tab. Also store this selected tab in localStorage potentially so that the preferred tab for the user is always selected across the site.