• Settings
    • Locale
    • Change the locale of the datepicker, schedule and client side validation messages.

      Language
      English
      English
      English
      French
      German
      German
      German
      Italian
      Korean
      Spanish
      Catalan
      Dutch
      Portuguese
      Portuguese
      Arabic
      Arabic
      Bulgarian
      Bangla
      Bosnian
      Czech
      Greek
      Estonian
      Persian
      Finnish
      Danish
      Hindi
      Indonesian
      Icelandic
      Croatian
      Japanese
      Hungarian
      Hebrew
      Georgian
      Central Kurdish
      Khmer
      Kyrgyz
      Kazakh
      Lithuanian
      Latvian
      Malay
      Norwegian
      Polish
      Romanian
      Russian
      Slovak
      Slovenian
      Serbian
      Serbian
      Swedish
      Thai
      Turkish
      Ukrainian
      Uzbek
      Vietnamese
      Chinese
      Chinese
  • Resources
Theme
Theme
Preset primefaces.THEME
Apple Liquid Glass style: translucent overlays, menus and bars that blur the page behind them, capsule buttons.
Color scheme color-scheme
Input style p-input-filled
Density data-p-density
Direction primefaces.DIR
Colors
Primary --p-primary-base
Surface --p-surface-*
Shape and motion
Button shape --p-button-border-radius
Shadows --p-*-shadow
Animations --p-transition-duration
Ripple --p-ripple-opacity
Border radius --p-border-radius-*
Typography
Focus ring
Form field
CSS
Only the tokens that differ from the preset.

                        
                    

SelectBooleanButton

SelectBooleanButton is used to select a boolean value with a toggle button. The examples show labels for the two states (onLabel, offLabel), icons (onIcon, offIcon), a button with icons only and the size attribute.

SelectBooleanButton Tag Documentation

SelectBooleanButton is used to select a binary decision with a toggle button.

NameTypeRequiredDefaultDescription
ariaLabelledBy String false
converterMessage String false
lang String false
onselect String false
requiredMessage String false
role String false
submittedValue Object false
validatorMessage String false
accesskey String false Access key to transfer focus to the input element.
label String false A localized user presentable name.
valueChangeListener ValueChangeListener false A method binding expression referring to a method for handling a valuchangeevent.
validator Validator false A method expression referring to a method validating the input.
binding UIComponent false generated An EL expression referring to a server side UIComponent instance in a backing bean.
rendered boolean false true Boolean value to specify the rendering of the component, when set to false component will not be rendered.
offLabel String false Custom label for off state.
onLabel String false Custom label for on state.
size String false Defines the size of the button, valid values are "small" and "large".
widgetVar String false Deprecated, use ref instead. Name of the client side component.
dir String false Direction indication for text that does not inherit directionality.
converter Converter false EL expression resolves to a converter instance or literal converter ID defining a component converter.
onmousedown String false Fires when a mouse button is pressed down on an element.
onmouseup String false Fires when a mouse button is released over an element.
onclick String false Fires when a mouse click on the element.
ondblclick String false Fires when a mouse double-click on the element.
onfocus String false Fires when an element gets focus.
onblur String false Fires when an element loses focus.
onkeydown String false Fires when a user is pressing a key.
onkeypress String false Fires when a user presses a key.
onkeyup String false Fires when a user releases a key.
onmousemove String false Fires when the mouse pointer is moving while it is over an element.
onmouseover String false Fires when the mouse pointer moves onto an element.
onmouseout String false Fires when the mouse pointer moves out of an element.
onchange String false Fires when the value of an element has been changed.
hideNoSelectionOption boolean false false Flag indicating that, if this component is activated by the user, The "no selection option", if any, must be hidden.
required boolean false false Marks component as required.
ref String false generated ('pf_' + componentClientId) Name of the client side component, e.g. to access it via PF('name').
style String false Specifies an inline CSS style for an element.
title String false Specifies extra information about an element (displayed as a tooltip).
styleClass String false Specifies one or more CSS class names for an element.
disabled boolean false false Specifies that an element should be disabled.
readonly boolean false false Specifies that an input field is read-only.
tabindex String false Specifies the tab order of an element.
ariaDescribedBy String false The aria-describedby attribute is used to define a component id that describes the current element for accessibility.
ariaLabel String false The aria-label attribute is used to define a string that labels the current element for accessibility.
offIcon String false The icon representing the "Off" position.
onIcon String false The icon representing the "On" position.
id String false generated Unique identifier of the component in a namingContainer.
value Object false Value of the component.
immediate boolean false false When set true, process validations logic is executed at apply request values phase for this component.
Loading...
Basic
No
With Icon
No
Icon Only
p-button
Sizes
No
No
No

Usage


<div class="card">
    <h:form>
        <p:growl id="msgs"/>

        <h5>Basic</h5>
        <p:selectBooleanButton onLabel="Yes" offLabel="No" style="width:6rem"/>

        <h5>With Icon</h5>
        <p:selectBooleanButton onLabel="Yes" offLabel="No"
                                onIcon="pi pi-check" offIcon="pi pi-times" style="width:6rem" />

        <h5>Icon Only</h5>
        <p:selectBooleanButton onIcon="pi pi-check" offIcon="pi pi-times" />

        <h5>Sizes</h5>
        <p:selectBooleanButton onLabel="Yes" offLabel="No" size="small" styleClass="w-4rem mr-4"/>
        <p:selectBooleanButton onLabel="Yes" offLabel="No" styleClass="w-5rem mr-4"/>
        <p:selectBooleanButton onLabel="Yes" offLabel="No" size="large" styleClass="w-6rem"/>

    </h:form>
</div>