Canvas Apps Controls Modern Controls User Experience

Toggle – Everything you want to know about modern control #22

Yes/no toggle
A hand holding a coin saying yes

Introduction to modern Toggle control

Toggle control has been around in Power Apps ever since Power Apps came into existence. So although it isn't a new control, the modern version has some minor differences (read: additions and some subtractions) when compared to the classic toggle control. This will probably be one of the shorter modern control blog posts as the differences between the classic and modern toggle are very minimal.

New Properties

  1. ToggleSize - As the name suggest, this is to control the size of the toggle

Renamed Properties

  1. Checked - This used to be called Default. The default value of the control
  2. Label - This replaces both TrueText & FalseText. You can specify the two values using the following expression:
    If(
        Self.Checked,
        "TrueText",
        "FalseText"
    )

Some of the properties to style this control are gone like FalseFill, TrueFill. This might seem a bit crippling to some makers, but trust me, losing some of these properties has been a blessing for me. Lack of these properties helps ensure that the controls look neat and clean.

Using modern Toggle control

The one property that some of the modern controls have lost in comparison to their classic versions is the Reset property. I do miss it at times. I used that property to reset controls to their default values using a variable. Now that the Reset property isn't there anymore, you can still reset controls by using the Reset function. To learn more about the Reset function, click here.

Stay tuned for the remaining modern controls!

To read the official documentation of modern controls, click here.

Recent articles

    1. Text Input - Everything you want to know about modern control #21
    2. Text – Everything you want to know about modern control #20
    3. Tab List – Everything you want to know about modern control #19

 

Leave a Reply