Skip to content

NbTabsetComponent: Tabset overflow-x should scroll #3283

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

Open
braydoncbell opened this issue Apr 1, 2025 · 0 comments
Open

NbTabsetComponent: Tabset overflow-x should scroll #3283

braydoncbell opened this issue Apr 1, 2025 · 0 comments

Comments

@braydoncbell
Copy link

braydoncbell commented Apr 1, 2025

Issue:

When using an NbTabsetComponent, the <ul> inside the tabset should scroll horizontally to improve UX, especially on small screens or when there are many tabs.

The responsive input parameter does not work well when tab titles contain arbitrary text and cannot be expressed by an icon.

Manually setting overflow-x: auto in the parent component's stylesheet causes the .tab.active .tab-link::before element inside nb-tabset to be mostly hidden.

Workaround:

To resolve this issue, I removed the border from the <ul> and created a custom border using the ::after pseudo-element. This allows margin or padding to be applied to <nb-tabset>, ensuring that the .tab.active .tab-link::before element is not clipped, preventing a vertical scrollbar.

nb-tabset .tabset {
    border-bottom: none;
    position: relative;
    overflow-x: auto;
    padding-bottom: 4px;
}

nb-tabset .tabset::after {
    content: "";
    position: absolute;
    bottom: 2px;
    left: 0;
    width: 100%;
    height: var(--tabset-divider-width);
    background: var(--tabset-divider-color);
}

nb-tabset .tab.active .tab-link::before {
    z-index: 1;
}

This approach ensures proper scrolling behavior while maintaining the visual integrity of the active tab indicator.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant