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

[Feature Request] Add active prop to NavLink #365

Open
AnnMarieW opened this issue Oct 18, 2024 · 0 comments
Open

[Feature Request] Add active prop to NavLink #365

AnnMarieW opened this issue Oct 18, 2024 · 0 comments

Comments

@AnnMarieW
Copy link
Collaborator

AnnMarieW commented Oct 18, 2024

It would be great to have an active prop on NavLink similar to Dash Bootstrap Components

active (boolean | a value equal to: 'partial', 'exact'; default False): Apply 'active' style to this component. Set to "exact" to automatically toggle active status when the current pathname matches href, or to "partial" to automatically toggle on a partial match. Assumes that href is a relative url such as /link rather than an absolute such as https://example.com/link For example - dbc.NavLink(..., href="/my-page", active="exact") will be active on "/my-page" but not "/my-page/other" or "/random" - dbc.NavLink(..., href="/my-page", active="partial") will be active on "/my-page" and "/my-page/other" but not "/random".

This makes it possible to show which link in a menu or side panel is active regardless of how you navigate to the page.

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