v2 add NavAnchor and NavButton
See original GitHub issueA common need for a UI app is a component that handles navigational links, where there is some built-in logic to handle the active route. A counterpart in react router is NavLink
.
It seems to me that Grommet should have two extra components: NavAnchor and NavButton. These components will add some logic for detecting if the route is active, and add styling to it. this style would live in the theme object, something like:
const myCustomTheme = {
navAnchor: {
active: css`
text-decoration: underline;
`
},
};
Thoughts?
Issue Analytics
- State:
- Created 5 years ago
- Comments:16 (15 by maintainers)
Top Results From Across the Web
How to handle the navigation for the Button click in ReactJS?
2. I am getting an error as "Cannot read property 'push' of undefined" ... npm install prop-types --save or yarn add prop-types.
Read more >Revolution Slider: Full screen is extending below fold. Can' ...
This is unlike the Integrity 1 demo which ends nicely at full screen, and the nav anchor is right above the fold and...
Read more >Migrating to v1
Local onSelect handlers are ignored when in the context of a TabContainer or Navbar (MAYBE ADD BACK?) Nav.Item#. Renders only the outer "item"...
Read more >dynamic navigation menu - Using Umbraco And Getting ...
Hi,. I'm trying to create a dynamic navigtaion menu as MegaNav isnt here for Umbraco8 yet. I've got the following code which works...
Read more >Changing color of active nav bar link
Andy_Vaughan (Jolly Good Web) April 19, 2020, 10:08am #2 ... the top right of the Designer when you have the nav button element...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Why not extend RoutedAnchor and RoutedButton?
I think we should not get tied to routing libraries, which would be required to “add some logic for detecting if the route is active”. Instead, I think we should ensure that we support
active
on Button and Anchor, along with theme-ability of that. We could provide starters/patterns/templates showing how to integrate with various routing libraries, such as react-router, nextjs, etc. For example, see RoutedButton.js in https://codesandbox.io/s/216vvpmlqj.