Custom Styling for Radio Buttons

Description

While the default HTML radio buttons work well for a number of applications it is sometimes useful to be able to customize the size, shape, and color or radio buttons. This ability is particularly useful for mobile applications which rely on an onPress event; where the normal size radio buttons might be too small for some fingers.

A customized radio button control
A customized radio button control

To see a video explanation of this guide see this video.

Customizing Radio Buttons

  1. In the UX Builder on the UX Controls page open the 'Data Controls' menu and click on the [RadioButton] option to add a radio button control to the component.

    Cust
  2. Highlight the Radio Button control. In the properties list scroll down to the Field Properties section, set the 'Width' property to 7in.

    Cust2
  3. In the 'RadioButton Properties' section click on the button next to the 'Choices' property.

    Cust3
  4. From the 'Choices are' menu select 'Static'

    Cust4
  5. Enter a list of choices to appear next to each radio button. Add one choice per line. Click OK.

    • Cust5
    • Cust6
  6. Check the 'Has custom design for Radio Buttons' checkbox.

    Cust7
  7. Click the button next to the 'Custom appearance designer' property.

    Cust8
  8. Check the 'Has checked image' property. By default custom radio buttons have a checkmark for this image.

    • Cust9
    • A checked image
      A checked image
  9. Click the button next to the 'Icon - checked' property.

    Cust11
  10. Select the 'Built-in Image' radio button and click 'Select'.

    Cust12
  11. Type 'green' into the Filter On textbox. Select the small green orb from the icon menu and click 'Insert'. Click OK.

    • Cust13
    • Cust14
  12. Change the 'Checkmark width' property to be 26px.

    • Cust15
    • Cust16
  13. Change the 'Checkmark height' property to be 26px.

    • Cust17
    • Cust18
  14. Change the 'Label indent' property to be 35px.

    • Cust19
    • Cust20
  15. Set the 'Vertical label alignment' to 'center'.

    • Cust21
    • Cust22
  16. Check the 'Has un-checked image' checkbox. This is the image that will fill a radio button that is not selected.

    Cust23
  17. Click the button next to the 'Icon - not checked' property.

    Cust24
  18. Choose the 'Built-in Image' radio button again an click 'Select'.

    Cust25
  19. Type 'red' into the 'Filter On' textbox and select the small red orb that appears in the menu. Click 'Insert' and OK.

    • Cust26
    • Cust27
  20. Uncheck both the 'Has checked image' and 'Has unchecked image' property. Check the 'Has checkmark background color' property.

    • Cust28
    • Cust29
  21. Click the button next to the 'Checkmark background color' property. From the color pallet select a desirable color.

    • Cust30
    • Cust31
  22. Change the 'Color gap' property to be 4px. This should shrink the size of the background color checkmark.

    • Cust32
    • Cust33
  23. Change the 'Checkmark border radius' property to be 20px. This will make the radio button appear more like a circle.

    • Cust34
    • Cust35
  24. Click the button next to the 'Checkmark border color' property and select a suitable color from the color picker. Click OK and OK again

    • Cust36
    • Cust37
  25. On the UX Controls page highlight the Radio Button control. In the 'Field Label' section of the properties list click on the button next to the 'Style' property.

    Cust38
  26. In the Style Editor's properties list scroll down to the 'Padding' section. Set the Bottom property to be 20px and click OK.

    Cust39
  27. Run the component in Live Preview

    Cust40