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

bottom-nav component #408

Open
jelbourn opened this issue May 9, 2016 · 55 comments
Open

bottom-nav component #408

jelbourn opened this issue May 9, 2016 · 55 comments
Labels
area: new Issues requesting a new component or area feature This issue represents a new feature or feature request rather than a bug or bug fix new component This issue is tracking a new component to be added to the library P5 The team acknowledges the request but does not plan to address it, it remains open for discussion

Comments

@jelbourn
Copy link
Member

jelbourn commented May 9, 2016

See https://material.io/design/components/bottom-navigation.html

@jelbourn jelbourn added the feature This issue represents a new feature or feature request rather than a bug or bug fix label May 9, 2016
@mikehaas763
Copy link

mikehaas763 commented May 9, 2016

Thanks for opening this up @jelbourn. I plan on implementing and have already begun some of the coding. I'm also working on writing up a design doc as you pointed out. There's several more things I need to think about that will hopefully come out in the design document but here's my initial thoughts.

I've been looking at an android/java implementation to learn from that: https://github.com/roughike/BottomBar

So far I've thought about providing a declarative approach such as

<md-bottomnav>
    <md-bottomnav-item>
    </md-bottomnav-item>
</md-bottomnav>

and a programatic approach that consumes an array

<md-bottomnav [items]="items">

The spec mentions that the component can be used for bottom navigation but it doesn't mention anything about its behavior automatically positioning itself to the bottom. I'm not sure if it's more in the spirit that using this component should automatically fix it to the bottom of its containing element, if it shouldn't be concerned with overall layout whatsoever (leaving that up to the consumer of the component), or if it should be a container component that takes up the full height of the view and has a projection area.

@jelbourn
Copy link
Member Author

jelbourn commented May 9, 2016

@mikehaas763

For the API, the first approach is preferable. When you want to include items programmatically, you would use ngFor on the item.

The bottom-nav should behave like the toolbar in WRT to the user being able to decide where to place it.

@kara
Copy link
Contributor

kara commented May 9, 2016

Agree with @jelbourn. Also, can we make it md-bottom-nav rather than md-bottomnav? Will be easier to read.

@mikehaas763
Copy link

@jelbourn makes sense, was thinking the same thing about ngFor but wasn't sure what would be more preferable.

@kara I agree. My thinking was that I wasn't sure if it should be consistent with sidenav. However, I think of sidenav as one word but with bottom not so much.

@mikehaas763
Copy link

@mikehaas763
Copy link

Thinking about the API a bit more while working on the design doc, the main piece of the component from a UI perspective is the set of icons. So I have to think about how to use MD icons and could use some feedback.

A few ideas:

  • Mimic some of the functionality that's in MdIcon in the MdBottomNavItem component (perhaps extracting pieces into services). This would mean create the same @Input()s, inject MdIconRegistry, etc.
  • Compose MdIcon within MdBottomNavItem and delegate to it
  • Subtype MdIcon with MdBottomNavItem. I haven't test this yet with A2 components and am not sure how well it works or if there are any edge cases related to decorators or other constructs.

Although I'm generally in the composition over inheritance camp as most people are, I think this may be a good use case for it. The nav items are essentially just icons. The only differences I know of being added on in the subtype right now are:

  1. optionally displaying a text label underneath
  2. communicating with the host element to have the ink effect that's specified in the spec starting at the location of the clicked icon

Thoughts?

@jelbourn
Copy link
Member Author

@mikehaas763 The content of the bottom-nav items should be completely up to the user. People will most likely put an <md-icon> in there, but the component itself should have no dependency on it.

It should be something like

<md-bottom-nav>
  <a md-nav-item ...> <md-icon>home</md-icon> </a>
  ...
</md-bottom-nav>

@mikehaas763
Copy link

@jelbourn I took this statement from the spec too literally: "Because bottom navigation actions are presented as icons, they should be used for content that can be suitably communicated with icons".

Meaning I thought it was a restriction material2 would want to match. That makes it a lot easier though so I'll just make that a projection area.

@mikehaas763
Copy link

@jelbourn Do you agree that the component should provide default styling so that if something like the following is used then it will look as it would in the spec?

<a md-nav-item>
  <md-icon>home</md-icon>
  <span>Home</span>
</a>

@jelbourn
Copy link
Member Author

@mikehaas763 yes, but it should be via an explicit attribute rather than looking for something like span. See md-card for examples of what I mean.

@mikehaas763
Copy link

update: I'm doing some prototyping to help flush out some design considerations I'm not sure of yet at mikehaas763/material2 in my bottomnav branch. master...mikehaas763:bottomnav

@DennisSmolek
Copy link

Forgive my ignorance, but I use a tabs for this exact same functionality... I use CSS to flip the views and you could do the same to hide the indicator. Looking at the design spec's it seems you could use the same code for both components instead of creating something totally different and having to maintain two implementations .

Here is an example of a simply flipped tabs component: http://plnkr.co/edit/hyacHu?p=preview

Tabs & Bottom Nav: Text or icons, full width, truncation, ripples,
Tabs: Indicator, scrollable
Bottom Nav: On the bottom
If you don't want the wrapped views you don't have to use the md-tabs-content directive

I'm just thinking adding a few attributes or css classes would be better than a whole new component..

@jelbourn
Copy link
Member Author

I see the bottom nav as being different from tabs in a few ways:

  • It same a slightly different visual presentation
  • It is only for navigation (essentially a <nav> containing <a> elements)
  • It is not paginated (which tabs will be eventually)

@DennisSmolek
Copy link

Right, but with so much being the same I was curious why have two codebases.
Tabs can be paginated, they don't have to be, especially because bottom navs are recommended to be no more than 4.

The biggest thing I get is semantically you wouldn't have it be "Tabs" as even though the code is identical the use case is different which I get..

@michaeljota
Copy link

Hi! Looking in the design doc, you forgot to include that in tablets and desktops this should be displayed aside, to the left.

btw. I agree this may share some code with tabs, but it would easier to understand if you separate concerns.

@mikehaas763
Copy link

mikehaas763 commented Sep 28, 2016

@michaeljota just for clarity purposes, my understanding of the spec is different.

Larger displays, like desktop, may achieve a similar effect by using side navigation.

This says to me that a consuming application can optionally choose to use a side nav on bigger displays, but not that the component itself should concern itself with resizing and snapping itself to a side nav.

If it were a valid use case in the future to have a component that did have knowledge to dynamically use a side nav or bottom nav based on screen size, then I'd think that should be a new component that wraps each respectively. Eg. AutoNavigationMenu etc :)

In any case, I'm starting small anyway and can add more features as time goes on.

@michaeljota
Copy link

michaeljota commented Sep 28, 2016

Yeah, I see your point. I'm spanish speaker, in spanish may and can are the same, and we almost take them as should, so that's on me.

But you are right, that may it's saying it is optional. This component should not care about being in a large screen or whatever. :)

@mikehaas763
Copy link

Does the library already have any utility styling for reseting hyperlinks to essentially no styling? I have to do something similar with this component's default styling.

image

@andrewseguin andrewseguin self-assigned this Nov 3, 2016
@jelbourn jelbourn added the P5 The team acknowledges the request but does not plan to address it, it remains open for discussion label Apr 9, 2017
@pyle
Copy link

pyle commented Jun 13, 2017

Hey all.
Have created a bottom-nav for a project I'm working on. The current implementation I have is as follows and programatic.
Ideally looking to contribute to the design doc and implenetation since I'm already using material2 for the project. Let me know what you think.

<bottom-nav [tabs]="navBarTabs"></bottom-nav>

With an interface for the tabs:

export interface NavTab {
  title: string;
  icon: string;
  link: string;
}

@Component({
  selector: 'bottom-nav',
  templateUrl: './bottom-nav.ng.html',
  styleUrls: ['./bottom-nav.scss']
})
export class BottomNavComponent {
  @Input() tabs: NavTab[];
}

Picture for reference:
screenshot 2017-06-13 at 11 40 49 am

@jelbourn
Copy link
Member Author

@pyle revisiting this, my current thinking is that the bottom-nav should have the same API as the tab-nav-bar:

<nav md-bottom-nav>
  <a md-bottom-nav-item routerLink="troubleshoot"> ... </a>
  <a md-bottom-nav-item routerLink="status"> ... </a>
  <a md-bottom-nav-item routerLink="faq"> ... </a>
</nav>

@pyle
Copy link

pyle commented Jun 13, 2017

@jelbourn I like that implmentation a lot better, easier to read from the HTML side. I'll start on the design doc sometime next week and open it up for comments

@robertofd1995
Copy link

Hello all, I have been working on in a component, but this one is using bootstrap 4, if any of you want to do an angular material version, just send a pull request it follows the api that you have been speaking here.

use-example

https://github.com/robertofd1995/BottomBar_Component

Thanks also to @pyle , he help me showing me his version

@baldo12
Copy link

baldo12 commented Sep 23, 2018

News?

@dominik-korsa
Copy link

@pyle It's been almost 2 YEARS since this issue started, and we still don't have a bottom navbar. Why is it taking so long?

@pyle
Copy link

pyle commented Oct 23, 2018

Hey all, sorry for the silence but I've been pretty busy as of late (and the times before).
While it has been a while since an update and since i've actually worked on this please note that I don't work on material full time (nor am i developer fulltime) and can't give as many cycles as I'd like without coding 24/7/365 :)

That being said, im going to dig up my previous code and see where I got up to. From memory I had it working no issues but needed to add some tests and polish up some of the styles.

@GoNode5
Copy link

GoNode5 commented Oct 25, 2018

https://twitter.com/stephenfluin/status/1054499414461472768
Why is @StephenFluin requesting this, while md-bottom-nav one still on the list ?

@StephenFluin
Copy link
Contributor

@GoNode5 Hey there! We use multiple sources of information to try to prioritize between technical debt, refactoring, new features, new components, bugfixing, API changes, and more. Not everyone reads our GitHub issues, so combining conversations with developers, information from social media channels, and our GitHub issues & PRs gives us a more holistic picture of developer needs and wants.

@max-SS
Copy link

max-SS commented Oct 26, 2018

App bars: bottom
Are there plans to give native support to this component?
Material Guidelines
image

@Splaktar
Copy link
Member

Splaktar commented Nov 9, 2018

@max-SS that's offtopic for this thread on bottom navigation.

There is an issue for App bars: top. But I don't see one for App bars: bottom yet. Would you like to open a feature request?

@max-SS
Copy link

max-SS commented Dec 20, 2018

Ok thank you very much for the correction.

@shifatul-i

This comment has been minimized.

@Spawnrad

This comment has been minimized.

@DenSchiep

This comment has been minimized.

@basicBrogrammer

This comment has been minimized.

@Splaktar Splaktar added the new component This issue is tracking a new component to be added to the library label Apr 10, 2019
@Splaktar
Copy link
Member

Please feel free to click the 👍 in the OP to express your interest in this feature. It is currently a P5, the lowest priority and it is listed in the repo's README that it is "not planned".

If you need this functionality soon, please look at creating your own implementation and possibly contributing it to an open source project like https://github.com/tiaguinho/material-community-components.

@Splaktar Splaktar changed the title md-bottom-nav mat-bottom-nav Apr 10, 2019
@Splaktar Splaktar changed the title mat-bottom-nav bottom-nav component Apr 10, 2019
@danieldaeschle

This comment has been minimized.

@angular angular deleted a comment from Martin-Andersen May 14, 2019
@breningham
Copy link

So, i've got a bottombar written in Angular, using Angular Material Theming.

Here's a Stackblits: https://stackblitz.com/edit/mat-bottom-bar
Demo: https://mat-bottom-bar.stackblitz.io/

@Splaktar reckon this could be a candidate for the community components?

@Splaktar
Copy link
Member

Splaktar commented Jun 24, 2019

@breningham as mentioned in #408 (comment), bottom navigation (this issue) is different from App bars: bottom. However, I think that would be a good contribution to https://github.com/tiaguinho/material-community-components. Also I think that the shadow should be on top, rather than bottom, for a bottom app bar.

@Splaktar
Copy link
Member

Related: MDC's issue for tracking the bottom navigation feature.

I've opened #16367 to track the creation of a mat-bottom-app-bar.

@jlandsmann
Copy link

New year, new component? Any updates here?

@Splaktar
Copy link
Member

@jlandsmann no updates here. This P5 issue is very low priority at this time.
It's likely that MDC would need to implement material-components/material-components-web#59 (which hasn't had any movement on it) before one would be added to Angular Material.

@karocksjoelee

This comment has been minimized.

@FANMixco
Copy link

FANMixco commented May 5, 2021

This seems like an option: https://github.com/kevlatus/ngx-bottom-nav#readme

@f-mon
Copy link

f-mon commented Jan 29, 2023

hi are there any plans to add this component?, i've try to read the whole conversation but it's not clear to me, what is the official angular-material team position about this feature request:

  1. will be implemented? (if so there are plans)
  2. will not be implemented but there is an official suggested workoround (ex: use tabs)
  3. other...
    Please someone of the angular material team could clarify?
    Thank you for your works!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: new Issues requesting a new component or area feature This issue represents a new feature or feature request rather than a bug or bug fix new component This issue is tracking a new component to be added to the library P5 The team acknowledges the request but does not plan to address it, it remains open for discussion
Projects
None yet
Development

No branches or pull requests