The zip code form is wrapped in grid columns that constrain the width at certain breakpoints. The stackUntil
prop is set to lg
so the input and button begin displaying side-by-side at that breakpoint.
Same as above, except the zip code form can accept an initial zip code value
, facilitating the pre-population of zip codes from a form. This feature is beneficial for scenarios where a pre-determined zip code needs to be set, which users can subsequently modify. If the user does not alter the zip code, it will default to the initial value provided.
Same as above, except the zip code form is inside a container with a dark background and the dark
prop is set to true
.
This form has stackUntil
set to sm
and appears within a smaller-width container. It has constrained
set to true
in order to make better use of the limited space. This reduces the horizontal padding on the submit button and reduces the size of the privacy text.
This form has stackUntil
set to xs
so it is always side-by-side. It also has the privacy section disabled by setting showPrivacySection
to false
.
This example remains stacked at every breakpoint, in a limited-width container. This shows how the form would display within a card on the sidebar of a page.
This example shows how to specify a product parameter that will be passed along when the form is submitted.
This example shows how to use the contextMessage
prop to display a message above the ZIP code input.
Enter your ZIP code to get started.
buttonText
String
'Submit'
errorMessage
String
'Please enter a 5-digit zip code.'
privacyExplanation
String
'Your information is safe with us.'
privacyPolicyLinkText
String
'Privacy Policy'
constrained
Boolean
false
contextMessage
String
''
dark
Boolean
false
fieldName
String
'zip_code'
inputId
String
newTab
Boolean
false
placeholder
String
'ZIP code'
showPrivacySection
Boolean
true
privacyPolicyLink
String
''
privacyPolicyNewTab
Boolean
false
stackUntil
String
''
url
String
selectedProduct
String
''
zipCodeValue
String
''