btnGroupRadioCheckbox.ftl

 1   <#-- Macro: btnGroupRadioCheckbox
 2   
 3   Description: Generates a radio button or checkbox within a button group.
 4   
 5   Parameters:
 6   - type (string, optional): the type of input, either 'checkbox' or 'radio'.
 7   - color (string, optional): the color of the button, defaults to 'primary'.
 8   - size (string, optional): the size of the button.
 9   - name (string, optional): the name attribute of the input.
 10   - id (string, optional): the ID attribute of the input.
 11   - params (string, optional): additional parameters to add to the input.
 12   - ariaLabel (string, optional): the ARIA label of the input.
 13   - labelFor (string, optional): the ID of the label for the input.
 14   - labelKey (string, optional): the i18n key of the label for the input.
 15   - labelParams (string, optional): additional parameters to add to the label.
 16   - tabIndex (string, optional): the tab index of the input.
 17   - value (string, optional): the value attribute of the input.
 18   - checked (boolean, optional): whether the input is checked by default.
 19   -->
 20   <#macro btnGroupRadioCheckbox type='checkbox' color='primary' size='' name='' id='' params='' ariaLabel='' labelFor='' labelKey='' labelParams='' tabIndex='' value='' checked=false>
 21   <label class="btn btn-${color}<#if size!=''> btn-${size}</#if>" for="${labelFor}"<#if labelParams!=''> ${labelParams}</#if>>
 22   <input type="${type}" name="${name}" id="${id}" autocomplete="off"<#if value!=''> value="${value}"</#if><#if params!=''> ${params}</#if><#if tabIndex!=''> tabindex="${tabIndex}"</#if><#if checked> checked</#if> /><#if labelKey!=''><span class="ms-1">${labelKey}<span></#if>
 23   </label>
 24   </#macro>