Consent checkbox
sms_marketing capability of the Customer Privacy capability group to work.The consent checkbox component collects customer approval for a given policy. Use consent checkbox to gather opt-in consent for SMS marketing.
Consent checkboxes support a policy attribute that connects to Shopify's consent framework. For standard multi-purpose checkboxes, use checkbox instead.
Only the sms-marketing policy is supported. Consent state is managed by Shopify and persisted automatically — custom storage isn't supported.
Supported targets
- customer-account.
footer. render-after - customer-account.
order-index. announcement. render - customer-account.
order-index. block. render - customer-account.
order-status. announcement. render - customer-account.
order-status. block. render - customer-account.
order-status. cart-line-item. render-after - customer-account.
order-status. cart-line-list. render-after - customer-account.
order-status. customer-information. render-after - customer-account.
order-status. fulfillment-details. render-after - customer-account.
order-status. payment-details. render-after - customer-account.
order-status. return-details. render-after - customer-account.
order-status. unfulfilled-items. render-after - customer-account.
order. action. menu-item. render - customer-account.
order. action. render - customer-account.
order. page. render - customer-account.
page. render - customer-account.
profile. addresses. render-after - customer-account.
profile. announcement. render - customer-account.
profile. block. render - customer-account.
profile. company-details. render-after - customer-account.
profile. company-location-addresses. render-after - customer-account.
profile. company-location-payment. render-after - customer-account.
profile. company-location-staff. render-after - customer-account.
profile. payment. render-after
Supported targets
- customer-account.
footer. render-after - customer-account.
order-index. announcement. render - customer-account.
order-index. block. render - customer-account.
order-status. announcement. render - customer-account.
order-status. block. render - customer-account.
order-status. cart-line-item. render-after - customer-account.
order-status. cart-line-list. render-after - customer-account.
order-status. customer-information. render-after - customer-account.
order-status. fulfillment-details. render-after - customer-account.
order-status. payment-details. render-after - customer-account.
order-status. return-details. render-after - customer-account.
order-status. unfulfilled-items. render-after - customer-account.
order. action. menu-item. render - customer-account.
order. action. render - customer-account.
order. page. render - customer-account.
page. render - customer-account.
profile. addresses. render-after - customer-account.
profile. announcement. render - customer-account.
profile. block. render - customer-account.
profile. company-details. render-after - customer-account.
profile. company-location-addresses. render-after - customer-account.
profile. company-location-payment. render-after - customer-account.
profile. company-location-staff. render-after - customer-account.
profile. payment. render-after
Anchor to PropertiesProperties
Configure the following properties on the consent checkbox component.
- Anchor to accessibilityLabelaccessibilityLabelaccessibilityLabelstringstring
A label used for users using assistive technologies like screen readers. When set, any children or
labelsupplied will not be announced. This can also be used to display a control without a visual label, while still providing context to users using screen readers.- Anchor to checkedcheckedcheckedbooleanbooleanDefault: falseDefault: false
Whether the control is currently checked.
- Anchor to commandcommandcommand'--auto' | '--show' | '--hide' | '--toggle''--auto' | '--show' | '--hide' | '--toggle'Default: '--auto'Default: '--auto'
Sets the action the
target should take when this component is activated. Available options:'--auto': Performs the default action appropriate for the target component.'--show': Displays the target component if it's currently hidden.'--hide': Conceals the target component from view.'--toggle': Alternates the target component between visible and hidden states.'--copy': Copies the target clipboard item.
The supported actions vary by target component type. Learn more about the
commandattribute.- Anchor to commandForcommandForcommandForstringstring
The ID of the component to control when this component is activated. Pair with the
commandproperty to specify what action to perform on the target component. Learn more about theattribute.When both
andhrefare set,takes precedence. The command runs and the link doesn't navigate.- Anchor to defaultCheckeddefaultCheckeddefaultCheckedbooleanbooleanDefault: falseDefault: false
Whether the control is checked by default.
- Anchor to disableddisableddisabledbooleanbooleanDefault: falseDefault: false
Whether the control is disabled, preventing any user interaction.
- Anchor to errorerrorerrorstringstring
An error message displayed below the field to indicate validation problems. When set, the field is styled with error indicators and the message is announced to screen readers.
- Anchor to idididstringstring
A unique identifier for the element. Use this to reference the element in JavaScript, link labels to form controls, or target specific elements for styling or scripting.
- Anchor to labellabellabelstringstring
The text displayed as the control label, which identifies the purpose of the control to users. This label is associated with the control for accessibility.
- Anchor to namenamenamestringstring
The name attribute for the control, used to identify its value when the form is submitted. Must be unique within the nearest containing form.
- Anchor to policypolicypolicy'sms-marketing''sms-marketing'
The policy for which buyer consent is being collected. Used by the consent checkbox and consent phone field components to identify the type of marketing permission requested.
sms-marketing: Represents the policy for SMS marketing consent.
- Anchor to valuevaluevaluestringstring
The value used in form data when the control is checked.
Anchor to EventsEvents
The consent checkbox component provides event callbacks for handling user interactions. Learn more about handling events.
- Anchor to changechangechangeCallbackEventListener<typeof tagName>CallbackEventListener<typeof tagName>
A callback fired when the consent checkbox value changes.
Learn more about the change event.
CallbackEventListener
A typed event listener for custom element events. The listener receives a `CallbackEvent` with the correct `currentTarget` type for the associated custom element tag.
(EventListener & {
(event: CallbackEvent<TTagName, TEvent>): void;
}) | nullCallbackEvent
An event type that narrows the `currentTarget` to the specific HTML element associated with the custom element tag. This provides type-safe event handling in callback listeners.
TEvent & {
currentTarget: HTMLElementTagNameMap[TTagName];
}Anchor to ExamplesExamples
Anchor to Collect SMS marketing consentCollect SMS marketing consent
Add a pre-checked consent checkbox for SMS marketing. This example displays a consent checkbox with defaultChecked, a label, and the sms-marketing policy.Collect SMS marketing consent

html
Anchor to Display an unchecked consent promptDisplay an unchecked consent prompt
Present an opt-in consent prompt that starts unchecked. This example uses a consent checkbox without defaultChecked so the customer must actively opt in.html
Anchor to Best practicesBest practices
- Be transparent: Write labels that clearly describe what the customer is consenting to, such as "Text me with news and offers."
- Use supported policies: Always set the
policyattribute to a supported value likesms-marketingso Shopify can track consent. - Respect opt-in preferences: Default to unchecked unless opt-out is the intended behavior for the policy.
- Don't duplicate consent: Avoid rendering multiple consent checkboxes for the same policy on the same page.