web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Can not make the width...
Power Apps
Unanswered

Can not make the width of the Component library dynamic

(0) ShareShare
ReportReport
Posted on by 3,514

I am building a component library, which have a main icon and when clicking on the main icon i want to show/hide the other icons. When showing the other icons i want to set the width of the component to be App.Width*0.1 else to be App.Width*0.5.. now i set this formula on the main icon OnSelect:-

 

johnjohn123_0-1697453047489.png

 

 

but i can not access the variable "varWidth" inside the component Width formula, as follow:-

 

johnjohn123_1-1697453105135.png

 

 

any advice?

 

Categories:
I have the same question (0)
  • Sanshubh Profile Picture
    512 on at

    Have you tried with showMenu variable?

    App.Width * If(showMenu,0.5,0.1)
  • johnjohn123 Profile Picture
    3,514 on at

    @SanshubhLubal same those variables are not recognized

  • Sanshubh Profile Picture
    512 on at

    @johnjohn123 
    You can do something like this

    1. Create a Output Property for Component

    SanshubhLubal_0-1697460488617.png


    Then set write this code on that Output Property 

    If(showMenu,App.Width,HamburgerHorizontal.Width)

    Now, write this on Width of Component

    ComponentName.MenuWidth

  • johnjohn123 Profile Picture
    3,514 on at

    @SanshubhLubal I tried this but did not work, where the component library will always occupy the same width, regardless if the icons are shown or not, as follow:-

     

    johnjohn123_0-1697463721700.png

     

    johnjohn123_1-1697463741653.png

     

     

    here is the MenuWidth formula i have:-

     

    johnjohn123_2-1697463806992.png

     

     

    and the width of the component :-

     

    johnjohn123_3-1697463833919.png

     

     

     

    this will work on the component library app itself, but will not work when adding the component library inside a canvas app.. any idea?

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 899

#2
Valantis Profile Picture

Valantis 571

#3
11manish Profile Picture

11manish 499

Last 30 days Overall leaderboard