Overview
The Whatsapp component provides a direct WhatsApp messaging option for customers. It features a WhatsApp icon, call-to-action button with hover effects, and detailed instructions for placing orders. The component includes fade-up animations triggered by intersection observers.Component code
Props
This component does not accept any props. The WhatsApp phone number is hardcoded in the component.Usage example
The Whatsapp component is imported and used within the Contactanos component to provide multiple contact options.
Contact information
+52 1 477 576 9503Formatted as WhatsApp link:
https://wa.me/5214775769503Styling details
Container layout
Container layout
- Flexbox column layout with centered content
- Outer container centers content horizontally and vertically
- Inner container: 80% width on mobile, 50% width on large screens
- All content centered using
text-centerutility
WhatsApp icon
WhatsApp icon
SVG icon with the following properties:
- Size: 50x50 pixels
- Color: Green-500 (
text-green-500) - Auto margins for horizontal centering
- 0.75rem bottom margin (mb-3)
- Tabler Icons WhatsApp brand icon
- Stroke width: 2px
Button styling
Button styling
Typography
Typography
- Heading (h2): 2xl text size (1.5rem), 1.25rem bottom margin
- Button text: lg text size (1.125rem)
- Instructions: lg text size, light font weight (300), gray-600 color
- All text centered for visual balance
Animation
Animation
The entire component animates into view:
- Animation type: Fade-up (slides up while fading in)
- Duration: 1000ms (1 second)
- Timing: Ease-in function
- Frequency: Once only (doesn’t repeat on scroll back)
- Trigger: When component enters viewport
Spacing
Spacing
- Top section: 2.5rem padding, 1.25rem top/bottom margins
- Bottom instructions: 2.5rem bottom margin
- Button: 1.25rem bottom margin from heading
Ordering instructions
The component displays important ordering guidelines:“Al momento de hacer una cotización con nosotros por mensaje o por whatsapp, indícanos el modelo, el color y la fragancia deseada con por lo menos 4 días con de anticipación de la fecha deseada de entrega.”Translation: When requesting a quote via message or WhatsApp, indicate the model, color, and desired fragrance at least 4 days in advance of the desired delivery date.
- Model/design of the candle
- Color preference
- Fragrance selection
- Delivery date (at least 4 days in advance)
Best practices
Responsive behavior
- Mobile devices: Container uses 80% width for comfortable padding on small screens
- Large screens (lg breakpoint): Container reduces to 50% width for better readability and focus
- Icon and button: Maintain consistent sizing across all breakpoints
- Text: Remains centered and readable on all screen sizes
Dependencies
- Tailwind CSS: Layout, typography, colors, transitions, and responsive design
- Tabler Icons: WhatsApp SVG icon
- Intersection Observer API: Powers the
intersect:animation trigger - WhatsApp Web/API: Opens WhatsApp conversation with the specified number
