Git Product home page Git Product logo

Comments (7)

stevoland avatar stevoland commented on April 28, 2024

Hi, no docs for DropdownMenu but I think the API is the same as DropdownButton. It's children should be MenuItems and it accepts an onSelect prop that is passed the key of the selected item as it's argument. It doesn't have any other functionality than that.

from react-bootstrap.

mattatcha avatar mattatcha commented on April 28, 2024

Well it seems like it doesn't show anything when I try to use it in a
nav-bar. It doesn't have a title property either.

On Mon, May 12, 2014 at 12:22 AM, Stephen J. Collings <
[email protected]> wrote:

Hi, no docs for DropdownMenu but I think the API is the same as
DropdownButton. It's children should be MenuItems and it accepts an
onSelect prop that is passed the key of the selected item as it's
argument. It doesn't have any other functionality than that.

β€”
Reply to this email directly or view it on GitHubhttps://github.com//issues/75#issuecomment-42771740
.

Matt Aitchison
Founder & CEO
Lanciv LLC

from react-bootstrap.

stevoland avatar stevoland commented on April 28, 2024

I don't think it's designed to be used directly in a Navbar. It just encapsulates the shared menu rendering between DropdownButton and SplitButton. I'm not sure its part of the public API really. Why would it have a title property?

from react-bootstrap.

mattatcha avatar mattatcha commented on April 28, 2024

Well this is how I trying to use it. Is this not a correct use case?

                <ul className="nav navbar-nav pull-right">
                  <li className="dropdown">
                    <a href="#" className="dropdown-toggle" data-toggle="dropdown">
                      <i className="fa fa-user fa-fw"></i> Matt Aitchison
                      <b className="caret"></b>
                    </a>
                    <DropdownMenu>
                      <MenuItem key="1">Dropdown link</MenuItem>
                      <MenuItem key="2">Dropdown link</MenuItem>
                    </DropdownMenu>
                  </li>
                </ul>

from react-bootstrap.

stevoland avatar stevoland commented on April 28, 2024

Ah, no. I think we just have to do a bit of work on DropdownButton to allow it to be used in a Navbar and be styled correctly.

from react-bootstrap.

stevoland avatar stevoland commented on April 28, 2024

I've added the ability to add DropdownButtons into 'Nav`s to master f7ab634.

You should be able to achieve your use-case like this:

    var title = <span><i className="fa fa-user fa-fw"></i> Matt Aitchison</span>;
    <Navbar>
      <Nav>
        <DropdownButton key={3} title={title}>
          <MenuItem key="1">Dropdown link</MenuItem>
          <MenuItem key="2">Dropdown link</MenuItem>
        </DropdownButton>
      </Nav>
    </Navbar>

from react-bootstrap.

mattatcha avatar mattatcha commented on April 28, 2024

Awesome! I just had a chance to test this and it seems to work properly. Thanks!

from react-bootstrap.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.