CheckoutButton
The CheckoutButton component is a reusable Angular component that integrates a button with promotional information, designed for e-commerce and lead generation workflows.
Features
- Integrated Components: Combines
IconButtonComponentandDiscountInfoComponentfor seamless user interaction and promotional display. - Flexible Layout: Supports a centered layout using the
centerclass. - Dynamic Button: Provides a customizable button that emits events for interactions.
- Promotional Messaging: Displays a discount or promotional offer below the button.
Usage
Step 1: Import the Component
Add the CheckoutButtonComponent to your Angular project by including it in your module or component imports array.
Step 2: Add the Template
Include the component in your template:
Configuration
Default Layout
The component includes a button and promotional message, arranged vertically. Add it to your page as follows:
Centered Layout
To center-align the button and promotional content, use the center class:
This will align the content in a column layout with centralized positioning.
Component Structure
HTML Template
The CheckoutButtonComponent includes the following:
- Button: Customizable via
IconButtonComponentfor text, icon size, and event handling. - Promotional Info: Displays discount offers using
DiscountInfoComponent.
Example
Styling
Customize the layout by overriding styles in your global or component-specific stylesheets.
Centered Layout Styling
The center class applies the following styles to center-align content:
Example
Display a checkout button with promotional information:
Center the layout for focused engagement:
Button Interaction
The IconButtonComponent triggers the onButtonClick method, which you can customize for various interactions, such as opening an external link: