Christmas Sale! Get 69% OFF for All Publii Themes Get the pack!

Christmas Sale 69% OFF! All Publii Themes

GitHub Download

Radio buttons

If you want to allow an user to select a value from the predefined list you can use radio buttons or the dropdown list.

Radio buttons have a special parameter to define available option values and their labels:

{
    "name": "layoutFrontpage",
    "label": "Frontpage layout",
    "group": "Layout",
    "value": "cols-3",
    "type": "radio",
    "options": [
        {
            "label": "1 column",
            "value": "cols-1"
        },
        {
            "label": "2 columns",
            "value": "cols-2"
        },
        {
            "label": "3 columns",
            "value": "cols-3"
        }
    ]
}

Above code will generate a radio buttons list with three options:

Radio buttons

Subscribe

Get the latest Publii news, updates and more delivered directly to your email inbox

You can change your mind at any time by clicking the unsubscribe link in the footer of any email you receive from us, or by contacting us at contact@tidycustoms.net. By clicking below, you agree that we may process your information in accordance with our Privacy Policy.