Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

121
Vistas
Two Navbar rows in React-Bootstrap

I am trying to mimic this Navbar:

enter image description here

In React-Bootstrap, I am thinking of having two Navbars both on top of each other, for this I have added these files:

MainNav.tsx

import React from 'react';
import { Navbar, Container, Nav } from 'react-bootstrap';

export default function MainNav() {
  return (
    <Navbar expand="md" className="justify-content-center navbar-top" fixed="top">
      <Nav className="me-auto">
        <Navbar.Brand href="#home">Minimal Blog</Navbar.Brand>
      </Nav>
    </Navbar>
  )
}

Navbar.tsx:

import React from 'react';
import { Navbar, Container, Nav } from 'react-bootstrap';

export default function NavigationBar() {
  return (
    <Navbar expand="md" className="justify-content-center navbar-top" fixed="top">
        <Nav className="me-auto">
          <Nav.Link href="#home">Blog</Nav.Link>
          <Nav.Link href="#features">About</Nav.Link>
        </Nav>
    </Navbar>
  )
}

And in the App.tsx, I am just adding these:

<MainNav />
<Navbar />

But seems like they are super imposing on each other, I have created a code sandbox here: https://codesandbox.io/s/peaceful-sun-se4ni?file=/src/App.tsx for Replication, any help/hints in making the desired output possible will be helpful.

EDIT 1: I have added two Navbars, and utilised the z-index property, but somehow, I am not able to align contents together. Here is the sandbox link: https://codesandbox.io/s/peaceful-sun-se4ni?file=/src/App.tsx

about 4 years ago · Juan Pablo Isaza
3 Respuestas
Responde la pregunta

0

the problem is that both of these navbars has the CSS property of position: fixed; so they are intertwining with each other to fix the issue you can override the CSS property by giving elements a class that would have a position:unset property

about 4 years ago · Juan Pablo Isaza Denunciar

0

In app.tsx You're importing NavigationBar but you're writing You don't need two navbars, you need one navbar and align the elements that you on the right.

Check these examples https://getbootstrap.com/docs/4.0/components/navbar/#containers

I think you need mr or something like that.

about 4 years ago · Juan Pablo Isaza Denunciar

0

With regards to EDIT 1, you have a container wrapped around your main nav and not in the second component. That's what is causing the alignment issue.

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda