CardConsentComponentConfig
View the reference for the CardConsentComponentConfig
file.
Reference
import CardConsentComponentConfig from "@pxpio/web-components-sdk/src/components/cardConsentComponents/types/CardConsentComponentConfig";
const cardConsentConfig: CardConsentComponentConfig = {
label: string,
labelStyles: {
checked: {
color: string,
fontWeight: string,
fontSize: string
},
unchecked: {
color: string,
fontSize: string
}
},
checked: boolean,
checkedColor: string,
tabIndex: number
};
const cardConsent = pxpCheckoutSdk.create("card-consent");
Properties
Property | Description |
---|---|
label string | The text label to display next to the consent checkbox. |
labelStyles object | Custom styles for the consent checkbox's label. |
labelStyles.checked object | Details about the styles to apply the checkbox is checked. |
labelStyles.checked.color string | The HEX colour code of the text. |
labelStyles.checked.fontWeight string | The weight of the font. |
labelStyles.checked.fontSize string | The size of the font. |
labelStyles.unchecked object | Details about the styles to apply when the checkbox is unchecked. |
labelStyles.unchecked.color string | The HEX colour code of the text. |
labelStyles.unchecked.fontSize string | The size of the font. |
checked boolean | The initial state of the checkbox. |
checkedColor string | The HEX colour code of the checkbox, when checked. |
tabIndex number | The tab index of the component. |
Example
import CardConsentComponentConfig from "@pxpio/web-components-sdk/src/components/cardConsentComponents/types/CardConsentComponentConfig";
const cardConsentConfig: CardConsentComponentConfig = {
label: "I agree to the terms and conditions",
labelStyles: {
checked: {
color: "#4CAF50",
fontWeight: "bold",
fontSize: "14px"
},
unchecked: {
color: "#666666",
fontSize: "14px"
}
},
checked: false,
checkedColor: "#4CAF50",
tabIndex: 1,
};
const cardConsent = pxpCheckoutSdk.create("card-consent");
Updated 15 days ago