The Pay Button component (fs-pay-button) submits the payment when the customer clicks it. Styles apply directly as CSS on the underlying <button> element. Any valid CSS property in camelCase is accepted.
The component also includes two regional disclosure slots that render automatically when the session calls for them: the Brazilian IOF fees disclaimer and the GDPR data-privacy notice.
This page is the complete reference for the Pay Button: how to mount it, the states it exposes, and every style category and property available. For setup context, see the Integration Guide.
Mount
Add a target element to your HTML:
<div id="pay-button-element"></div>Then create the component from your sdk instance and mount it:
const payButtonComponent = sdk.components.create('fs-pay-button', {
// style goes here
});
payButtonComponent.mount('#pay-button-element');How styling works
Styling is configured through a style object with per-state overrides. Each state contains one or more style categories (button, text, spinner, iofDisclaimer, gdprNotice).
sdk.components.create('fs-pay-button', {
style: {
state: {
default: { /* base styling */ },
hover: { /* mouse hover */ },
active: { /* mouse-down / tap */ },
disabled: { /* before session loads, or during processing */ },
error: { /* payment error */ },
valid: { /* payment valid */ },
},
},
});Style precedence (most specific wins):
- State-specific category styles (e.g.,
state.hover.button) - Default category styles (
state.default.button) globalStylespassed toFastSpring.init(), which is applied as base defaults across all components
Available states
| State | Selector | When applied |
|---|---|---|
default | button | Always (the base styling) |
hover | button:hover | Mouse hover |
active | button:active | Mouse down / tap |
disabled | button:disabled | Session not yet loaded, or payment in progress |
error | button (host [error]) | Payment error |
valid | button (host [valid]) | Payment valid |
Style categories
Each category below targets a specific part of the Pay Button component. Select a card to jump to its full property reference.
button: the button element
button: the button element| Property | Type | Default | Description |
|---|---|---|---|
backgroundColor | string | #2563eb | Button background color |
color | string | #ffffff | Button label color |
border | string | solid 0px | Shorthand border (e.g. '2px solid red') |
borderColor | string | #008aff | Button border color |
borderRadius | string | 8px | Button corner radius |
padding | string | 28px | Button inner padding |
margin | string | 0px | Button outer margin |
width | string | 400px | Button width |
height | string | 54px | Button height |
fontFamily | string | Helvetica | Button font family |
fontSize | string | 16px | Button font size |
fontWeight | string | 400 | Button font weight |
cursor | string | pointer | Button cursor style |
opacity | string | 1 | Button opacity |
Any other valid CSS property in camelCase is accepted and applied directly to the <button> element.
text: the button label
text: the button labelStyles applied to the <span> inside the button. When not set on text, each property inherits from the same-named property on button via CSS inheritance.
| Property | Type | Default | Description |
|---|---|---|---|
color | string | inherits from button.color (#ffffff) | Text color |
fontSize | string | inherits from button.fontSize (16px) | Text font size |
fontWeight | string | inherits from button.fontWeight (400) | Text font weight |
fontFamily | string | inherits from button.fontFamily (Helvetica) | Text font family |
spinner: the loading spinner
spinner: the loading spinnerShown while a payment is in flight. The spinner is a circular SVG arc filled with a linear gradient. The four named properties below map to CSS custom properties on :host; any other valid CSS property in camelCase is applied directly to the <svg> element.
| Property | Type | Default | Description |
|---|---|---|---|
colorStart | string | #F5F5F5 | Gradient start color (top of the arc) |
colorMid | string | #C8C8C8 | Gradient mid-point color |
colorEnd | string | #888888 | Gradient end color (bottom of the arc) |
size | string | 2rem | Width and height of the spinner SVG |
iofDisclaimer: Brazilian IOF fees disclaimer
iofDisclaimer: Brazilian IOF fees disclaimerRendered only when the session's complianceMessages array contains "SHOW_IOF_MESSAGE".
| Property | Type | Default | Description |
|---|---|---|---|
fontSize | string | .75rem | Font size of the disclaimer text |
color | string | #6b7280 | Text color of the disclaimer |
gdprNotice: GDPR data-privacy notice
gdprNotice: GDPR data-privacy noticeRendered for customers in GDPR-applicable countries (EU member states, UK, Norway, Switzerland, Japan). Includes auto-populated links to Terms of Service and Privacy Policy.
| Property | Type | Default | Description |
|---|---|---|---|
fontSize | string | .75rem | Notice font size |
color | string | #6b7280 | Notice text color |
linkColor | string | #2563eb | Terms / Privacy Policy link color |
linkHoverColor | string | #1d4ed8 | Link color on hover |
Default values per state
Out of the box, only the disabled and focus states change the button visually. Other states (hover, active, error, valid) accept overrides but apply no default differentiation. Set them explicitly if you want differentiated hover or interaction styling.
disabled
disabledApplied when the session hasn't loaded or a payment is in progress.
| Property | Default override value |
|---|---|
button.opacity | .5 |
button.cursor | not-allowed |
focus
focusApplied when the button has keyboard focus.
| Property | Default override value |
|---|---|
button.outline | 2px solid #3b82f6 |
button.outlineOffset | 2px |
hover, active, error, valid
hover, active, error, validThe SDK declares CSS variables for these states (--fs-pay-button-hover-background, etc.) but defaults them to the same values as the default state. Visual differentiation only appears when you override them.
Full example
const payButtonComponent = sdk.components.create('fs-pay-button', {
style: {
state: {
default: {
button: {
backgroundColor: '#2563EB',
color: '#ffffff',
borderRadius: '8px',
width: '100%',
height: '54px',
fontSize: '16px',
fontWeight: '600',
},
text: {
fontFamily: 'Inter, sans-serif',
},
spinner: {
colorStart: '#DBEAFE',
colorMid: '#93C5FD',
colorEnd: '#1E40AF',
size: '1.5rem',
},
gdprNotice: {
fontSize: '12px',
color: '#6B7280',
linkColor: '#2563EB',
linkHoverColor: '#1E40AF',
},
},
hover: {
button: {
backgroundColor: '#1E4FC0',
},
},
active: {
button: {
backgroundColor: '#1E3A8A',
},
},
disabled: {
button: {
backgroundColor: '#9CA3AF',
cursor: 'not-allowed',
},
},
},
},
});
payButtonComponent.mount('#pay-button-element');Related pages
- Integration Guide: end-to-end integration walkthrough.
- Card: the companion component that collects card details.
- Disclosures: reseller disclosure block.
