Skip to content
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

tabs vertical #2666

Open
zfranco55 opened this issue May 17, 2024 · 5 comments
Open

tabs vertical #2666

zfranco55 opened this issue May 17, 2024 · 5 comments
Labels
feature request Request a feature or introduce and update to the project.
Milestone

Comments

@zfranco55
Copy link

Describe the feature in detail (code, mocks, or screenshots encouraged)

Is possible implement vertical left/right side version of tabs component?

What type of pull request would this be?

Enhancement

Provide relevant links or additional information.

No response

@zfranco55 zfranco55 added the feature request Request a feature or introduce and update to the project. label May 17, 2024
@Sarenor
Copy link
Contributor

Sarenor commented May 24, 2024

Tabs have already been completed for v3, did we consider a vertical mode for them @endigo9740 ?

@zfranco55
Copy link
Author

I hope implementation will be considered

@endigo9740
Copy link
Contributor

It is being considered for v3, but poses a number of challenges to get the styling just right, while also keeping it customizable. It's not as simple as swapping from a row to column as you might think.

@endigo9740 endigo9740 added this to the v3.0 (Next) milestone May 24, 2024
@zfranco55
Copy link
Author

zfranco55 commented May 24, 2024

It seemed simple to me, reading this link:
https://www.w3schools.com/howto/howto_js_vertical_tabs.asp

@endigo9740
Copy link
Contributor

endigo9740 commented May 24, 2024

@zfranco55 tabs are not a browser native UI component, which means there's no set standard on how they are designed and built. W3 Schools is simply demonstrating one of many different ways this interface can be constructed. For comparison, you can take a look at how Skeleton implements tabs here:

https://github.com/skeletonlabs/skeleton/tree/master/packages/skeleton/src/lib/components/Tab

Remember, we're building components, which means some level of abstraction around the HTML/CSS is happening here. Then we're applying our own theme and style prop systems on-top of this.

In order to support a vertical layout we would have to:

  1. Provide a vertical prop which takes a true/false value on the TabGroup
  2. Toggle the group template between flex row/column respectively
  3. Pass the vertical prop down to each Tab component through the Svelte Context API
  4. Then adjust the styling of the Tab component to move the active state indicator (underline) to the proper position

That last step is the most involved and becomes more troublesome if we wish to support both left and right alignment in the vertical state.

So again, I'll echo that it's technically possible, but likely beyond the scope of changes we're willing and able to implement in Skeleton v2. We are, as mentioned, considering this for Skelton v3 - as we're already rebuilding the components to take advantage of Svelte 5 and a number of other foundational changes to Skeleton itself. So we're taking that opportunity to introduce new features and structural changes.

If you need an interim solution, I might suggest Listbox, which operates in a similar manner:
https://www.skeleton.dev/components/listboxes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Request a feature or introduce and update to the project.
Projects
None yet
Development

No branches or pull requests

3 participants