<primer-card-form-submit>
Submit button for card forms with automatic localization and consistent styling. Wraps<primer-button> with card form integration.
Quick Reference
| Parent | <primer-card-form> |
| Properties | buttonText, variant, disabled |
| Emits | primer:card-submit (internal) |
Examples
Default
Custom Text
Secondary Variant
Disabled
Properties
| Property | Attribute | Type | Default | Description |
|---|---|---|---|---|
buttonText | buttonText | string | Localized “Pay” | Button text |
variant | variant | string | "primary" | Button style |
disabled | disabled | boolean | false | Disable button |
Events
Emitted Events
| Event | When | Payload |
|---|---|---|
primer:card-submit | Button clicked | None — signals <primer-card-form> to validate and submit |
Note: The event is dispatched withbubbles: trueandcomposed: trueso it crosses shadow DOM boundaries to reach<primer-card-form>.
Relevant Parent Events
| Event | Emitted by | How it affects this button |
|---|---|---|
primer:state-change | <primer-checkout> | When isProcessing is true, the button shows a loading spinner and becomes non-interactive |
Dispatching the same event externally
Alternative Submit Methods
| Method | Example |
|---|---|
| HTML button | <button type="submit">Pay</button> |
| Primer button | <primer-button type="submit">Pay</primer-button> |
data-submit | <button data-submit>Pay</button> |
| Event | document.dispatchEvent(new CustomEvent('primer:card-submit', { bubbles: true, composed: true })) |
CSS Properties
Typography
| Property | Description | Default |
|---|---|---|
--primer-typography-title-large-size | Button text size | 16px |
--primer-typography-title-large-weight | Button text weight | 550 |
Colors (Primary Variant)
| Property | Description |
|---|---|
--primer-color-brand | Button background color |
--primer-color-gray-000 | Button text color (white) |
Colors (Secondary Variant)
| Property | Description |
|---|---|
--primer-color-background-outlined-default | Default background |
--primer-color-background-outlined-hover | Hover background |
--primer-color-border-outlined-default | Default border |
--primer-color-text-primary | Button text color |
Border & Shape
| Property | Description | Default |
|---|---|---|
--primer-radius-medium | Button border radius | 8px |
--primer-space-medium | Horizontal padding | 12px |
States
| Property | Description |
|---|---|
--primer-color-background-outlined-disabled | Disabled background |
--primer-color-text-disabled | Disabled text |
--primer-color-background-outlined-loading | Loading background |
Animation
| Property | Description | Default |
|---|---|---|
--primer-animation-duration | Transition duration | 200ms |
--primer-animation-easing | Transition easing | cubic-bezier(0.44, 0, 0.4, 1) |
States
| State | Description | Visual Change |
|---|---|---|
| Default | Ready for click | Brand color background (primary) or outlined (secondary) |
| Hover | Mouse over button | Slightly darker background |
| Active | Button pressed | Further darkened background |
| Focus | Keyboard focused | Focus ring visible |
| Loading | Form submitting | Spinner displayed, text hidden |
| Disabled | disabled attribute set | Muted colors, no interaction |
Content Guidelines
| Do | Don’t |
|---|---|
| ”Pay now" | "Submit" |
| "Complete payment" | "Pay" |
| "Pay $49.99" | "OK” |
Usage Guidelines
Do
- Use for consistent, localized submit buttons
- Place inside
<primer-card-form>
Don’t
- Don’t set
buttonTextto empty string (reverts to default)
Related
- primer-card-form — Parent container
- Events Guide — Submission events