# Service Card Component ## Overview The `service-card` component is a reusable Blade component designed to display service statistics in a clean, modern card format with hover effects and tooltips. ## Usage ### Basic Usage ```blade ``` ### With Animation Delay ```blade ``` ## Props | Prop | Type | Default | Description | |------|------|---------|-------------| | `icon` | string | `'box'` | Lucide icon name | | `iconColor` | string | `'text-green-400'` | Tailwind CSS color class for icon | | `badgeColor` | string | `'bg-green-400'` | Tailwind CSS color class for badge | | `title` | string | `''` | Badge title text | | `value` | mixed | `0` | Main value to display | | `label` | string | `''` | Label text below value | | `tooltip` | string | `''` | Tooltip text on hover | | `animationDelay` | float | `0` | Animation delay in seconds | ## Features - **Responsive Design**: Adapts to different screen sizes - **Hover Effects**: Scale animation on hover - **Tooltips**: Alpine.js powered tooltips with smooth transitions - **Animation**: Staggered fade-in animations - **Accessibility**: Proper ARIA attributes and keyboard navigation - **Internationalization**: Supports Laravel's translation system ## Styling The component uses Tailwind CSS classes and includes: - Shadow effects - Rounded corners - Smooth transitions - Background decorations - Responsive grid layout ## Dependencies - **Laravel Blade**: For component rendering - **Tailwind CSS**: For styling - **Alpine.js**: For interactive features - **Lucide Icons**: For icon display - **Animate.css**: For animations (optional) ## Example Implementation ```php // In your controller $serviceCards = [ [ 'icon' => 'box', 'iconColor' => 'text-green-400', 'badgeColor' => 'bg-green-400', 'title' => __('Services'), 'value' => count($services), 'label' => __('Services'), 'tooltip' => __('Total active services') ], // ... more cards ]; return view('dashboard', compact('serviceCards')); ``` ```blade
@foreach($serviceCards as $index => $card) @endforeach
``` ## Customization You can customize the component by: 1. Modifying the component file directly 2. Publishing the component to your app directory 3. Creating a new component that extends this one 4. Using CSS custom properties for theming ## Best Practices 1. **Use meaningful icons**: Choose Lucide icons that represent the data 2. **Consistent colors**: Use a consistent color scheme across cards 3. **Proper translations**: Always use Laravel's translation system 4. **Accessible text**: Provide meaningful tooltips and labels 5. **Performance**: Keep animation delays reasonable (0.1s intervals) 6. **Mobile-first**: Ensure cards work well on mobile devices