# Change navbar header background colour Ionic

**URL:** <https://forum.ionicframework.com/t/change-navbar-header-background-colour-ionic/48498>\
**Category:** ionic-v3\
**Created:** [April 5, 2016, 6:28pm UTC](https://forum.ionicframework.com/t/change-navbar-header-background-colour-ionic/48498 "2016-04-05T18:28:10Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![pbul2004](https://avatars.discourse-cdn.com/v4/letter/p/54ee81/32.png) [@pbul2004](https://forum.ionicframework.com/u/pbul2004)\
**Post date:** [April 5, 2016, 6:28pm UTC](https://forum.ionicframework.com/t/change-navbar-header-background-colour-ionic/48498/1 "2016-04-05T18:28:10Z")

</div>

Hi,

I want to change the colour of the navbar header in my Ionic 2 / Angular 2 app, how would i do this?

This CSS in DOM is `.toolbar-background`

```
<ion-navbar *navbar>
  <ion-title>
    Header title
  </ion-title>
</ion-navbar>

```

In the older version it was as simple as: -

```
<div class="bar bar-header bar-stable">
  <h1 class="title">bar-stable</h1>
</div>

```

I want to have the header blue, with a white icon on the left and a white icon on the right, across all pages?

Any ideas,

Thanks

---

<div class="post-metadata">

**Author:** ![rlouie](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/rlouie/32/134973_2.png) [@rlouie](https://forum.ionicframework.com/u/rlouie)\
**Post date:** [April 5, 2016, 8:11pm UTC](https://forum.ionicframework.com/t/change-navbar-header-background-colour-ionic/48498/2 "2016-04-05T20:11:14Z")

</div>

You want `.toolbar-background`

```
.toolbar-background {
  background-color: blue;
}

```

Here’s a pen: [http://codepen.io/anon/pen/qZVKWM](http://codepen.io/anon/pen/qZVKWM)

---

<div class="post-metadata">

**Author:** ![pbul2004](https://avatars.discourse-cdn.com/v4/letter/p/54ee81/32.png) [@pbul2004](https://forum.ionicframework.com/u/pbul2004)\
**Post date:** [April 5, 2016, 8:15pm UTC](https://forum.ionicframework.com/t/change-navbar-header-background-colour-ionic/48498/3 "2016-04-05T20:15:03Z")

</div>

So you have to manually over-ride the global CSS rather than applying different class’s / themes like in Ionic v1?

eg: bar-balanced class etc?

In the example below how would you add white btn icons left and right?

```
<ion-navbar *navbar>
  <ion-title>
    Header title
  </ion-title>
</ion-navbar>

```

Also - the navbar - would you create this as a page directive and insert that template into all pages, rather than re-writing it on all pages?

Thanks for the reply.

Seems a lot more messing to do this compared to v1

---

<div class="post-metadata">

**Author:** ![rlouie](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/rlouie/32/134973_2.png) [@rlouie](https://forum.ionicframework.com/u/rlouie)\
**Post date:** [April 5, 2016, 8:18pm UTC](https://forum.ionicframework.com/t/change-navbar-header-background-colour-ionic/48498/4 "2016-04-05T20:18:53Z")

</div>

Well, you could just apply your own class to the `<ion-title>`

Here’s the updated pen: [http://codepen.io/anon/pen/qZVKWM](http://codepen.io/anon/pen/qZVKWM)

But if you do that you have to put it on each tab. It sounded to me like you _wanted_ to override the default style since you wanted it everywhere.

---

<div class="post-metadata">

**Author:** ![pbul2004](https://avatars.discourse-cdn.com/v4/letter/p/54ee81/32.png) [@pbul2004](https://forum.ionicframework.com/u/pbul2004)\
**Post date:** [April 5, 2016, 8:22pm UTC](https://forum.ionicframework.com/t/change-navbar-header-background-colour-ionic/48498/5 "2016-04-05T20:22:22Z")

</div>

Yeah ill have to override the default styling rather than add a class.

I just thought that you could add the ionic classes to the navbar and build up your navbar that way like in the older versions, in the above code example, if not ill override it. Cheers

---

<div class="post-metadata">

**Author:** ![sava999](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/sava999/32/98776_2.png) [@sava999](https://forum.ionicframework.com/u/sava999)\
**Post date:** [April 5, 2016, 8:32pm UTC](https://forum.ionicframework.com/t/change-navbar-header-background-colour-ionic/48498/6 "2016-04-05T20:32:06Z")

</div>

> [@pbul2004](#):
>
> In the older version it was as simple

It is simple now to 🙂

```
<ion-navbar *navbar primary></ion-navbar>
<ion-navbar *navbar secondary></ion-navbar>
<ion-navbar *navbar danger></ion-navbar>

```

etc…

Enjoy!

---

<div class="post-metadata">

**Author:** ![pbul2004](https://avatars.discourse-cdn.com/v4/letter/p/54ee81/32.png) [@pbul2004](https://forum.ionicframework.com/u/pbul2004)\
**Post date:** [April 5, 2016, 8:34pm UTC](https://forum.ionicframework.com/t/change-navbar-header-background-colour-ionic/48498/7 "2016-04-05T20:34:55Z")

</div>

> [@sava999](#):
>
> primary

Brilliant! Thank you.

How do you add icons left and right with the new setup?

---

<div class="post-metadata">

**Author:** ![sava999](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/sava999/32/98776_2.png) [@sava999](https://forum.ionicframework.com/u/sava999)\
**Post date:** [April 5, 2016, 8:39pm UTC](https://forum.ionicframework.com/t/change-navbar-header-background-colour-ionic/48498/8 "2016-04-05T20:39:06Z")

</div>

Something like this?

```
<ion-navbar *navbar primary hideBackButton="true">
  <ion-buttons>
    <button>
      <ion-icon name="arrow-back"></ion-icon>
    </button>
  </ion-buttons>

  <ion-buttons end>
    <button>
      <ion-icon name="checkmark"></ion-icon>
      Save
    </button>
  </ion-buttons>
</ion-navbar>
```

---

<div class="post-metadata">

**Author:** ![pbul2004](https://avatars.discourse-cdn.com/v4/letter/p/54ee81/32.png) [@pbul2004](https://forum.ionicframework.com/u/pbul2004)\
**Post date:** [April 5, 2016, 8:42pm UTC](https://forum.ionicframework.com/t/change-navbar-header-background-colour-ionic/48498/9 "2016-04-05T20:42:00Z")

</div>

Yes 🙂 Thanks for your help, spot on!

---

<div class="post-metadata">

**Author:** ![NooNoo](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/noonoo/32/90942_2.png) [@NooNoo](https://forum.ionicframework.com/u/NooNoo)\
**Post date:** [April 30, 2016, 11:43am UTC](https://forum.ionicframework.com/t/change-navbar-header-background-colour-ionic/48498/10 "2016-04-30T11:43:23Z")

</div>

Is it correct that you have to set the ion-navbar colour on every page now then or is there a way to add the colour variable once and have it applied to each page? I tried setting it in the app.html on the ion-nav but that doesn’t seem to work.

Thanks

---

<div class="post-metadata">

**Author:** ![sava999](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/sava999/32/98776_2.png) [@sava999](https://forum.ionicframework.com/u/sava999)\
**Post date:** [April 30, 2016, 5:36pm UTC](https://forum.ionicframework.com/t/change-navbar-header-background-colour-ionic/48498/11 "2016-04-30T17:36:19Z")

</div>

Setting that in app.html will not work because every new screen is show over past screen and app.html is just like some wrapper.

Sorry I don’t know how could you set this color in one place.

---

<div class="post-metadata">

**Author:** ![russcarver](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/russcarver/32/121615_2.png) [@russcarver](https://forum.ionicframework.com/u/russcarver)\
**Post date:** [October 27, 2016, 3:06am UTC](https://forum.ionicframework.com/t/change-navbar-header-background-colour-ionic/48498/12 "2016-10-27T03:06:01Z")

</div>

Unfortunately, this no longer appears to work in the latest version of Ionic2 (as of 10/25/16 - `ionic -version` = 2.1.4) with the following dependencies in package.json:

```
"@angular/common": "2.0.0",
"@angular/compiler": "2.0.0",
"@angular/compiler-cli": "0.6.2",
"@angular/core": "2.0.0",
"@angular/forms": "2.0.0",
"@angular/http": "2.0.0",
"@angular/platform-browser": "2.0.0",
"@angular/platform-browser-dynamic": "2.0.0",
"@angular/platform-server": "2.0.0",
"@ionic/storage": "1.0.3",
"ionic-angular": "2.0.0-rc.1",
"ionic-native": "2.2.3",

```

To solve, this I had to add the following to app.scss:

```
.toolbar-background {
    background-color: blue;
}
```

---

<div class="post-metadata">

**Author:** ![vaibsVB](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/vaibsvb/32/102515_2.png) [@vaibsVB](https://forum.ionicframework.com/u/vaibsVB)\
**Post date:** [October 27, 2016, 6:19am UTC](https://forum.ionicframework.com/t/change-navbar-header-background-colour-ionic/48498/13 "2016-10-27T06:19:50Z")

</div>

This work for me. In `variable.scss` I added the property as `navbarColor: #009688`

```
$colors: (
  primary: #387ef5,
  secondary: #32db64,
  danger: #f53d3d,
  light: #f4f4f4,
  dark: #222,
  favorite: #69BB7B,
  navbarColor: #009688
);

```

And added in my `home.html` at the `ion-navbar` element.  
`<ion-navbar color='navbarColor'></ion-navbar>`

---

<div class="post-metadata">

**Author:** ![romanrast](https://avatars.discourse-cdn.com/v4/letter/r/c2a13f/32.png) [@romanrast](https://forum.ionicframework.com/u/romanrast)\
**Post date:** [November 2, 2016, 12:30am UTC](https://forum.ionicframework.com/t/change-navbar-header-background-colour-ionic/48498/14 "2016-11-02T00:30:28Z")

</div>

> [@vaibsVB](#):
>
> \<ion-navbar color=‘navbarColor’\>\</ion-navbar\>

for me this worked  
`<ion-navbar navbarColor></ion-navbar>`

---

<div class="post-metadata">

**Author:** ![fiznool](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/fiznool/32/103943_2.png) [@fiznool](https://forum.ionicframework.com/u/fiznool)\
**Post date:** [November 16, 2016, 11:33am UTC](https://forum.ionicframework.com/t/change-navbar-header-background-colour-ionic/48498/15 "2016-11-16T11:33:17Z")

</div>

With Ionic 2 rc2 we have the following variables we can use to change the toolbar appearance:

```auto
$toolbar-background
$toolbar-border-color
$toolbar-text-color
$toolbar-active-color
$toolbar-inactive-color

```

---

<div class="post-metadata">

**Author:** ![0x1AD2](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/0x1ad2/32/107851_2.png) [@0x1AD2](https://forum.ionicframework.com/u/0x1AD2)\
**Post date:** [December 2, 2016, 7:43am UTC](https://forum.ionicframework.com/t/change-navbar-header-background-colour-ionic/48498/16 "2016-12-02T07:43:21Z")

</div>

Can confirm this worked for me (using RC3)

```
$toolbar-background: #123456;
$toolbar-border-color: #123456;
$toolbar-text-color: #123456;
$toolbar-active-color: #123456;
$toolbar-inactive-color: #123456;

```

Thanks! @fiznool

---

<div class="post-metadata">

**Author:** ![muhammedmoussa](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/muhammedmoussa/32/102622_2.png) [@muhammedmoussa](https://forum.ionicframework.com/u/muhammedmoussa)\
**Post date:** [December 9, 2016, 1:06am UTC](https://forum.ionicframework.com/t/change-navbar-header-background-colour-ionic/48498/17 "2016-12-09T01:06:04Z")

</div>

works for me…  
`<ion-navbar no-border-bottom [color]="isAndroid ? 'primary' : 'light'">`

---

<div class="post-metadata">

**Author:** ![veljkoz](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/veljkoz/32/105106_2.png) [@veljkoz](https://forum.ionicframework.com/u/veljkoz)\
**Post date:** [January 15, 2017, 10:51pm UTC](https://forum.ionicframework.com/t/change-navbar-header-background-colour-ionic/48498/18 "2017-01-15T22:51:32Z")

</div>

Hm, doesn’t seem to work in rc4? I’ve tried setting these values directly in app.scss, but there’s no effect… e.g.:

```
//(some app.scss file comments above)

$toolbar-background: red;
$toolbar-text-color: orange;

```

Am I doing something wrong here?

* * *

Apparently, I am 🙂 the variables part should go into the /src/theme/variables.scss file. It works as expected.

---

<div class="post-metadata">

**Author:** ![Arulmano](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/arulmano/32/107323_2.png) [@Arulmano](https://forum.ionicframework.com/u/Arulmano)\
**Post date:** [March 2, 2017, 4:00am UTC](https://forum.ionicframework.com/t/change-navbar-header-background-colour-ionic/48498/20 "2017-03-02T04:00:58Z")

</div>

It’s an simple concept so don’t get confuse on change navbar color.  
following codes are helpful to you…

```
<ion-navbar color="primary">
   
    <ion-title>Not Delivered Details</ion-title>
    <ion-buttons end>
      
 

    </ion-buttons>
</ion-navbar>

```

---

<div class="post-metadata">

**Author:** ![noir1412](https://avatars.discourse-cdn.com/v4/letter/n/e95f7d/32.png) [@noir1412](https://forum.ionicframework.com/u/noir1412)\
**Post date:** [March 13, 2017, 6:29pm UTC](https://forum.ionicframework.com/t/change-navbar-header-background-colour-ionic/48498/21 "2017-03-13T18:29:13Z")

</div>

Great work vaibsVB. Brilliant !!

[Next page](https://forum.ionicframework.com/t/change-navbar-header-background-colour-ionic/48498.md?page=2)
