Skip to content

Dynamic Font Size

Last edited 191 days ago by Lukas Pavelka.
The Dynamic Font Size function is created as Power Apps named Formula for getting font size according to selected layout size.

Formula Code

DynamicFontSize(ScreenSize:Number):Number = Switch(
ScreenSize,
6,
30,
5,
30,
4,
25,
3,
22,
2,
21,
21
);

Eye on Detail

Power Apps recognise different device layout. This layout represents Size property in your Canvas screen.
The list of size constants:
Screen Sizes
Name
Value
Device Type
ScreenSize.Small
1
Phone
ScreenSize.Medium
2
Tablet, held vertically
ScreenSize.Large
3
Tablet, held horizontally
ScreenSize.ExtraLarge
4
Desktop computer
There are no rows in this table
If you need to specify higher than Extra Large size, you can do it through the SizeBreakpoints property:
[576, 768,992,1200, 1400]

Demo

Select App and choose "Formulas" property, where your custom UDF function will be placed.
Screenshot 2025-09-21 at 6.49.24.png
Then go to your particular screen and choose some Label controls.
Screenshot 2025-09-21 at 6.45.54.png
Select your Label in your Power Apps scree, go to Font Size property, and put "DynamicFontSize" function with size of your screen as input value.

Output

I used my title "Tasker" label, where I put the function in FontSize property.
Screenshot 2025-09-21 at 6.33.42.png
Screenshot 2025-09-21 at 6.33.52.png


Want to print your doc?
This is not the way.
Try clicking the ··· in the right corner or using a keyboard shortcut (
CtrlP
) instead.