Installation
Usage
Web Results Only
Display only web results:With News
Include news articles with relevance scores:With Image Click Handler
Handle image clicks for lightbox or other interactions:Props
Object containing search results with optional
web, images, and news arrays.Optional callback function called when an image is clicked. Receives the image URL as a parameter.
Types
Features
Web Results
- Popover Display: Web results shown in a compact popover button
- Favicon Integration: Automatically fetches and displays site favicons
- Preview Stacking: Multiple favicons stacked for visual appeal
- Metadata: Shows domain, date, and truncated descriptions
- External Links: Opens in new tabs with proper security attributes
Image Results
- Validation: Automatically validates image URLs before display
- Lazy Loading: Images load progressively with skeleton loaders
- Animated Entrance: Staggered fade-in animations with framer-motion
- 3D Rotation: Alternating rotation effects on hover
- Z-index Management: Hovered images come to the front
- Click Handler: Optional callback for image interactions
- Responsive: Adapts to different screen sizes
News Results
- Relevance Scores: Display confidence scores for news articles
- Date Formatting: Automatically formats dates
- Truncated Content: Uses
line-clampfor clean previews - Hover Effects: Smooth transitions on interaction
- Icon Integration: News icon from Hugeicons library
Image Validation
The component includes built-in image validation that:- Attempts to load each image URL
- Filters out broken or invalid images
- Has a 5-second timeout per image
- Only displays successfully loaded images
- Shows nothing if no valid images exist
Styling
Web Results Button
- Compact button with favicon stack
- Semi-transparent background with backdrop blur
- Smooth hover transitions
- Popover with max-width and scrollable content
Image Grid
- Overlapping images with negative space (
-space-x-15) - Alternating rotation angles
- Smooth scale and blur animations
- Dynamic z-index for hover states
News Cards
- Card-based layout with borders
- Subtle shadows that grow on hover
- Truncated content for consistent heights
- Metadata display (score and date)
Accessibility
- Semantic HTML structure
- External links with
rel="noopener noreferrer" - Alt text for all images
- Keyboard navigation support through shadcn/ui components
- Loading states communicated visually
- Error handling for failed image loads
Performance
- Image validation runs in parallel with Promise.all
- Timeout prevents hanging on slow images
- Lazy loading with Next.js Image component
- Priority loading for first 3 images
- Component cleanup prevents memory leaks
- Efficient re-renders with React hooks
Common Use Cases
- AI Search Results: Display results from AI-powered search engines
- Content Discovery: Show related articles, images, and news
- Research Tools: Present comprehensive search data
- News Aggregators: Combine multiple news sources
- Image Galleries: Display validated image collections