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 / Custom Radio Button
Power Apps
Unanswered

Custom Radio Button

(0) ShareShare
ReportReport
Posted on by 20

Hello,

I am building a radio button like functionality using svg icons, see the image below
Button Component.png

=> The selected button should be highlighted in blue.
=> Only one button can be selected at a time and one button must be selected.

Note :  I am building this as a component, i will be integrating this with another component
I have somehow managed to change the color of the button upon selecting by setting variables, but I am not sure how to carry this out in component for the requirements mentioned above.

Categories:
I have the same question (0)
  • nickellis74 Profile Picture
    432 Moderator on at

    If only one can be active at a time, I would suggest storing a value in a variable and comparing against that to determine the state of the button.

    So the OnSelect would be

    UpdateContext({myVariable: "Value 1"})

     

    Then all the formatting would be

    If(myVariable="Value 1",{the formatting for selected},{the formatting for not selected})

     

    I think that's what you mean? Tell me if I've misunderstood 🙂

  • Rohit_RC Profile Picture
    20 on at

    Hi @nickellis74 , thanks for replying
    I am building this as a component and i reckon, UpdateContext can't be used in Components

  • nickellis74 Profile Picture
    432 Moderator on at

    You're correct. My apologies.

    Use Set() to specify the variable and set its value, and bind the output property to the value selected.

    I've just very quickly done an icon that changes color when clicked:

    nickellis74_0-1638542434625.png

    OnSelect is Set(myOutput,!myOutput) just to switch between True and False. Then this color formula uses that to specify the color of the icon.

     

    There is then a custom property called myVariable which is bound to myOutput so the component will output whatever the value if myOutput is:

    nickellis74_1-1638542554969.png

    A bit rushed, but hopefully that will help.

  • Rohit_RC Profile Picture
    20 on at

    well, the way you've set the variable behaves like toggle button, which is something that I don't want
    for eg. if i click the button once, it'll get filled with the color, and upon clicking the same button twice, the color will fade away (I don't want this to happen).

    Instead, what I want is - color of, say the left button should be disabled only when the right button is clicked & Vice Versa

  • nickellis74 Profile Picture
    432 Moderator on at

    I was just using color as an example property. You can set any property you like based on this.

    And for the radio button example, rather than using a boolean you would presumably assign a range of values like {1,2,3,4,5} and then with the first you'd say 

    If(myOutput = 1, DisplayMode.Disabled, DisplayMode.Enabled)

    and with the second 

    If(myOutput = 2, DisplayMode.Disabled, DisplayMode.Enabled)

     

    ...and so on.

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!

Leaderboard > Power Apps

#1
Haque Profile Picture

Haque 85

#2
WarrenBelz Profile Picture

WarrenBelz 76 Most Valuable Professional

#3
Kalathiya Profile Picture

Kalathiya 38 Super User 2026 Season 1

Last 30 days Overall leaderboard