arya-blue
luna-amber
luna-blue
luna-green
luna-pink
nova-dark
nova-light
saga-blue
vela-blue
Credit Card
Credit Card will take any credit card form and make it the best part of the checkout process. Just map the input fields to fields you probably already have!

IMPORTANT: You must use prependId="false" on the h:form and your ID's of your text fields must be "number", "name", "cvc", "expiry". See: Stack Overflow as to why.

Source

                <p:panelGrid id="pnlCreditCard" columns="4" layout="tabular">
        <f:facet name="header">
            <pe:creditCard id="creditCard" labelMonthYear="MM/YY" placeholderExpiry="**/**" placeholderName="Optimus Prime"/>
        </f:facet>
        <p:inputText id="number" placeholder="Card number" inputmode="numeric"/>
        <p:inputText id="name" placeholder="Full name"/>
        <p:outputPanel id="expiration">
            <p:datePicker id="month" widgetVar="monthPicker" view="month" pattern="MM/yy" yearNavigator="true" yearRange="2000:2050"
                          placeholder="MM/YY"
                          onchange="$('#expiry').val(PF('monthPicker').input.val()); $('#expiry')[0].dispatchEvent(new Event('change'));"/>
            <!-- Hide Expiration field so we can use PF MonthPicker -->
            <p:inputText id="expiry" placeholder="MM/YY" inputmode="numeric" style="display:none"/>
        </p:outputPanel>
        <p:inputText id="cvc" placeholder="CVC" inputmode="numeric"/>
    </p:panelGrid>
            
Components and more
Use Cases
Documentation pe:creditCard
Attributes (move mouse over the names to see data types)
Name Description
bindingAn EL expression referring to a server side UIComponent instance in a backing bean.Default is generated.
formattingWhether to format the card number with spaces.Default is true.
idUnique identifier of the component in a namingContainer.Default is generated.
labelMonthYearLabel for the month/year field.Default is month/year.
labelValidDateLabel for the valid date field.Default is valid thru.
placeholderCvcPlaceholder for the CVC input.
placeholderExpiryPlaceholder for the expiry date input.
placeholderNamePlaceholder for the cardholder name input.Default is Full Name.
placeholderNumberPlaceholder for the card number input.
renderedBoolean value to specify the rendering of the component, when set to false component will not be rendered.Default is true.
widgetVarName of the client side widget.
widthWidth of the credit card widget in pixels.Default is 350.
PrimeFaces Extensions Showcase - © 2011-2025,PrimeFaces: 16.0.0-SNAPSHOT,PrimeFaces Extensions: 16.0.0-SNAPSHOT,JSF: Apache MyFaces Core 4.0 - Impl 4.0.3,Server: Apache Tomcat (TomEE)/10.1.52 (10.1.4),Build time: 2026-03-14 23:18