Interactive testing environment for react-shared components
Current: Default
A checkbox component for collecting marketing consent with internationalization support
Customize the component properties and see the changes in real-time
Different component states
idstring - Custom ID for the checkbox (optional)
checkedboolean - Controlled checked state (optional, makes component controlled)
defaultCheckedboolean - Initial checked state for uncontrolled component (default: false)
disabledboolean - Disables the checkbox (default: false)
classNamestring - Additional CSS classes (optional)
onStateChanged(checked: boolean) => void - Callback when checked state changes (optional)
onSendAnalytic(event: string) => void - Analytics callback (optional)
The component can be used in both controlled and uncontrolled modes. Use the checked prop for controlled mode, or defaultChecked for uncontrolled mode.
The component uses the useTranslation hook to display localized text. The label text is retrieved from the translation key shared.marketing_consent.check_box_text.
When the checkbox state changes, the component triggers analytics events:product-purchase-marketing-consent-agreedwhen checked, andproduct-purchase-marketing-consent-rejectedwhen unchecked.
The component uses the StoreCheckboxGroup component which provides proper accessibility features including label association and keyboard navigation.