Topic: Navbar
Mugetsu free asked 6 years ago
NavbarBrand
with some custom name and image I want to hide the name on view ports with max-width: 768px. I was unable to achieve this with the class .d-sm-none nor d-md-none. Seems like they dont work. The .d-lg-none and bigger are working...
Secondly I feel like the navbar hamburger menu misses core functionality... For me in thesedays the approiate behaviour of the hamburger menu on small devices should be like:
- when its open and I click some navlink or dropdownitem it should redirect me to specific page and close the navbar collapse
- when its open and I do click outside it it should collapse.
Jakub Strebeyko staff answered 6 years ago
Hi there,
You specify the components rendered upon clicking the <NavLink>
(that take in a to
path prop) in a Routes.js
file, in Routes
' component render()
method, as <Switch>
children. I think you could find our app's a helpful example - just see docs/App.js
and docs/Routes.js
.
With Best Regards,
Kuba
pcdavis pro answered 6 years ago
Jakub Strebeyko staff answered 6 years ago
NavbarBrand
- is just not there yet. The component is rather straight-forward for the time being, but thanks for suggestion - we just might consider it.
2. We also appreciate you sharing your thoughts on modern hamburger menus - food for thought. To achieve the desired design (having a navbar menu collapse with clicking away), I suggest creating a fully transparent overlay component with a click event (that would be collapsing the menu, for example "handleOverlayClick()
") and displaying it beneath the dropped down navigation.
3. React Router is fun to use and it's fully React-y: clicking on a link does not necessarily re-render the whole page, what's more - you as a developer can decide on what changes and what stays. A great tool.
With Best Regards,
Kuba
pcdavis pro commented 6 years ago
Where do you specify what components show up when clicking on NavLinks? I have a single page app and need it to show different components based on the link they click.FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Answered
- ForumUser: Free
- Premium support: No
- Technology: MDB React
- MDB Version: -
- Device: -
- Browser: -
- OS: -
- Provided sample code: Yes
- Provided link: No