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] navbar component #16

Open
waspinator opened this issue May 20, 2018 · 2 comments
Open

[feature request] navbar component #16

waspinator opened this issue May 20, 2018 · 2 comments

Comments

@waspinator
Copy link

Petal looks great, thanks for creating it.

I think a navbar component would be a great addition to help get started. How do you feel about adding something like what bootstrap has?

https://getbootstrap.com/docs/4.1/components/navbar/

@zvuc
Copy link
Collaborator

zvuc commented May 24, 2018

Good suggestion! I've actually received this request before too from some other people around me. I'll think about what can be the best way I can implement this that will be useful for most of the users.

@markdreyer
Copy link

I'm using tab component with react/reach router for this and it works great for my simple little app!

    const navLinks = [
        { to: '/', text: 'Home' },
        { to: '/about', text: 'About' },
        { to: '/contact', text: 'Contact' },
        { to: '/news', text: 'News' }
    ]

        <div className="tab-group tab-style-01">
            <Location>
                {({ location }) =>
                    navLinks.map((lnk) =>
                        <Link key={lnk.to} to={lnk.to}>
                            <div className={`tab ${location.pathname === lnk.to ? 'selected' : ''}`} >
                                <span className="tab-label">{lnk.text}</span>
                            </div>
                        </Link>
                    )
                }
            </Location>
            <div className="tab spacer"></div>
        </div>

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

3 participants