# Perspective - How to reduce dock height when small breakpoint activated?

**URL:** <https://forum.inductiveautomation.com/t/perspective-how-to-reduce-dock-height-when-small-breakpoint-activated/48114>\
**Category:** Ignition\
**Tags:** ignition81, perspective\
**Created:** [June 23, 2021, 3:06pm UTC](https://forum.inductiveautomation.com/t/perspective-how-to-reduce-dock-height-when-small-breakpoint-activated/48114 "2021-06-23T15:06:50Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [June 23, 2021, 3:06pm UTC](https://forum.inductiveautomation.com/t/perspective-how-to-reduce-dock-height-when-small-breakpoint-activated/48114/1 "2021-06-23T15:06:50Z")

</div>

I have 2 docked header Views, one for PC (wide) one for mobile (narrow). The PC has more screen real estate so the header is taller. The mobile header is about half the height of the PC one. I have a breakpoint container to switch the two out, but at the moment the dock height remains at the PC height and looks stupid in mobile while also reducing precious content space.

How can I have two separate heights for these Views?

---

<div class="post-metadata">

**Author:** ![matthew.ayre](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/matthew.ayre/32/19499_2.png) [@matthew.ayre](https://forum.inductiveautomation.com/u/matthew.ayre)\
**Post date:** [June 24, 2021, 7:18am UTC](https://forum.inductiveautomation.com/t/perspective-how-to-reduce-dock-height-when-small-breakpoint-activated/48114/2 "2021-06-24T07:18:48Z")

</div>

I haven’t found a ‘graceful’ way so far (but I haven’t spent to much time on it to be honest).

The way I have chosen is to have two separate docks with their respective heights defined. I then use a startup script on my first loaded view to perform an openDock() based on the device type session prop. For slower clients I use a bit of animation to hide the transition a little bit. However, this doesn’t work for all scenarios 😞

I think there is a feature request somewhere to gain more control over docked windows.

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [June 24, 2021, 7:49am UTC](https://forum.inductiveautomation.com/t/perspective-how-to-reduce-dock-height-when-small-breakpoint-activated/48114/3 "2021-06-24T07:49:33Z")

</div>

I didn’t think about this / forgot about this 🙂  
I’ll give that a go, cheers!

I don’t really know what the best solution _would_ be to handle this. Maybe if there were scripting events for when the current viewport dimensions changed? That would also require the viewport dimensions to be provided (I think there were already being/been added?). What would also be nice would be to be able to dynamically size a dock via script.

---

<div class="post-metadata">

**Author:** ![nader.chinichian](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nader.chinichian/32/9261_2.png) [@nader.chinichian](https://forum.inductiveautomation.com/u/nader.chinichian)\
**Post date:** [June 24, 2021, 7:59am UTC](https://forum.inductiveautomation.com/t/perspective-how-to-reduce-dock-height-when-small-breakpoint-activated/48114/4 "2021-06-24T07:59:44Z")

</div>

With using new page dimensions check the status bar dock width if it is below certain point call system.perspective.opendock to open your mobile dock view and do this vice versa in mobile dock.  
You don’t need even use break point container any more.  
You just need to setup two dock for your top header.  
By default make desktop dock visible.

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [June 24, 2021, 8:00am UTC](https://forum.inductiveautomation.com/t/perspective-how-to-reduce-dock-height-when-small-breakpoint-activated/48114/5 "2021-06-24T08:00:40Z")

</div>

do you know what version these were added to?

---

<div class="post-metadata">

**Author:** ![matthew.ayre](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/matthew.ayre/32/19499_2.png) [@matthew.ayre](https://forum.inductiveautomation.com/u/matthew.ayre)\
**Post date:** [June 24, 2021, 8:01am UTC](https://forum.inductiveautomation.com/t/perspective-how-to-reduce-dock-height-when-small-breakpoint-activated/48114/6 "2021-06-24T08:01:04Z")

</div>

8.1.6

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [June 24, 2021, 8:01am UTC](https://forum.inductiveautomation.com/t/perspective-how-to-reduce-dock-height-when-small-breakpoint-activated/48114/7 "2021-06-24T08:01:37Z")

</div>

Cool! (and you mean 8.1.7 - we don’t speak of 8.1.6 😉 It’s the naughty child who drew all over your walls with texta, or permanent marker for those less ventured)

---

<div class="post-metadata">

**Author:** ![nader.chinichian](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nader.chinichian/32/9261_2.png) [@nader.chinichian](https://forum.inductiveautomation.com/u/nader.chinichian)\
**Post date:** [June 24, 2021, 8:01am UTC](https://forum.inductiveautomation.com/t/perspective-how-to-reduce-dock-height-when-small-breakpoint-activated/48114/8 "2021-06-24T08:01:59Z")

</div>

8.1.7 they omit 8.1.6

---

<div class="post-metadata">

**Author:** ![matthew.ayre](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/matthew.ayre/32/19499_2.png) [@matthew.ayre](https://forum.inductiveautomation.com/u/matthew.ayre)\
**Post date:** [June 24, 2021, 8:02am UTC](https://forum.inductiveautomation.com/t/perspective-how-to-reduce-dock-height-when-small-breakpoint-activated/48114/9 "2021-06-24T08:02:15Z")

</div>

Yes, I was going to add that 😜, technically 8.1.6 but major regression bug = 8.1.7

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [June 24, 2021, 11:56pm UTC](https://forum.inductiveautomation.com/t/perspective-how-to-reduce-dock-height-when-small-breakpoint-activated/48114/10 "2021-06-24T23:56:45Z")

</div>

Am I missing something? I upgraded to 8.1.7 but don’t see anything different ☹  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/9/3/933a83085d1e43effa2487d9efe82bafc86f1bc8.png)  
Unless the defaultSize updates?

Ooooo, I found it! Pays to actually read the change log 🙂 Verry nice, I am excite!  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/e/c/ecc313afcf073cf157b3dc3872eed0aa9c6f8c00.png)

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [June 25, 2021, 12:21am UTC](https://forum.inductiveautomation.com/t/perspective-how-to-reduce-dock-height-when-small-breakpoint-activated/48114/11 "2021-06-25T00:21:49Z")

</div>

Found an issue with using two navigation docks and showing/hiding based on dimensions… opening a dock is added to the history stack… so using the back navigation action will close the dock 🙂

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [March 6, 2025, 6:02am UTC](https://forum.inductiveautomation.com/t/perspective-how-to-reduce-dock-height-when-small-breakpoint-activated/48114/12 "2025-03-06T06:02:10Z")

</div>

Is there any foolproof way of doing this yet?

I've tried the two docks + startup script method, but this doesn't work when a new page is navigated to; the headers either disappear altogether or the height gets reset.

I've tried the breakpoint method with a single dock and using a startup script on each header (big and small) to set the dock height, however again when changing page, it just resets back to the dock's default height 😕

The most reliable method I've found is by creating a custom object prop on one of the headers (usually the PC version) with keys bound to:

- `page.props.dimensions.viewport.width`
- `page.props.primaryView`
- `page.props.dimensions.primaryView.height` (this is needed in case the same page url is opened again...)

Then add an onchange script to the object that looks at the page width and sets the dock height. However for mobile, the dock flashes up the big version for a split second and then hides it and shows the small one. Still not sure why...

I just want a foolproof way to set the dock height based on the width of the viewport...
