# Auto-sizing flex container to suit contents

**URL:** <https://forum.inductiveautomation.com/t/auto-sizing-flex-container-to-suit-contents/54244>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [December 17, 2021, 1:48pm UTC](https://forum.inductiveautomation.com/t/auto-sizing-flex-container-to-suit-contents/54244 "2021-12-17T13:48:09Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [December 17, 2021, 1:48pm UTC](https://forum.inductiveautomation.com/t/auto-sizing-flex-container-to-suit-contents/54244/1 "2021-12-17T13:48:09Z")

</div>

I feel I should know the answer to this but can’t think of the solution.

 ![Perspective datetime is in the future](https://us1.discourse-cdn.com/inductiveautomation/original/3X/4/3/438feac319696053a75585d1d17d53a0ec70a632.png)

This flex container will be used in an embedded view. Normally just the date picker will be visible so I want the flex container to be sized appropriately. When the warning message _display_ property is set to _true_ the flex container should expand to accommodate it. This view will be used as an embedded view on other views.

How should I achieve that?

_[I’m aware of how to limit the date picker select range. This is a stripped down version of my date / shift picker.]_\*

---

<div class="post-metadata">

**Author:** ![swolnisty](https://avatars.discourse-cdn.com/v4/letter/s/7bcc69/32.png) [@swolnisty](https://forum.inductiveautomation.com/u/swolnisty)\
**Post date:** [December 17, 2021, 6:15pm UTC](https://forum.inductiveautomation.com/t/auto-sizing-flex-container-to-suit-contents/54244/2 "2021-12-17T18:15:29Z")

</div>

Unless I’m missing something here, I think that wherever you embed this view, you will just need to set the position.basis to “auto” as long as you are embedding this view within another flex container (otherwise you would not have a position.basis property).
