Overview
Film components are the core building blocks for displaying movie and TV show content in Popcorn Vision. These components handle everything from hero sliders to card grids, managing both visual presentation and user interactions.HomeSlider
The main hero slider component displayed on the homepage, featuring full-screen film showcases with autoplay and navigation.Props
Array of film objects to display in the slider
Genre data for displaying film categories
Detailed film data including images (posters, backdrops, logos)
Usage Example
Features
- Swiper Integration: Uses Swiper.js with fade effects and keyboard navigation
- Responsive Images: Serves different images for mobile (poster) and desktop (backdrop)
- Thumbnail Navigation: Desktop view includes thumbnail previews for quick navigation
- Accessibility: Includes screen reader-only content with film details
FilmSlider
Horizontal scrolling carousel for displaying collections of films with navigation controls.Props
Object containing
results array of filmsSection title displayed above the slider
Sort order for films:
"DESC" or "ASC"URL for “View all” link. If empty, link is not shown
Usage Example
Implementation Details
Navigation Controls
Navigation Controls
Responsive Breakpoints
Responsive Breakpoints
Slides per group adjust based on screen size:
- 640px: 3 slides
- 768px: 4 slides
- 1024px: 5 slides
- 1280px: 6 slides
- 1536px: 7 slides
FilmCard
Individual film card component with poster image, rating badge, and hover effects.Props
Film object with properties:
id: Film IDtitleorname: Film titleposter_path: Poster image pathvote_average: Rating (0-10)release_dateorfirst_air_date: Release date
Whether the card is for a TV show
Features
Hover Preview
Integrates with
useHoverCard store to show detailed preview on hoverRating Badge
Color-coded rating indicator:
- Red: 0-3
- Yellow: 3-7
- Green: 7-10
Lazy Loading
Images load lazily with
loading="lazy" attributeAccessibility
Screen reader-only heading with title and year
Usage Example
Film/Card.jsx (excerpt)
FilmGrid
Responsive grid layout for displaying multiple films with infinite scroll loading.Props
Array of film objects to display
Callback function to fetch additional films when scrolling
Current page number
Total number of pages available
Loading state indicator
Whether this is the initial page load
Infinite Scroll Implementation
Grid Breakpoints
The grid uses container queries for responsive layouts:- Base: 3 columns
- @2xl: 4 columns
- @5xl: 5 columns
- @6xl: 6 columns
- @7xl: 7 columns
FilmSummary
Displays film metadata including title, rating, runtime, genres, and overview.Props
Film object with detailed information
Additional CSS classes
CSS classes for buttons
Whether to show the “Details” button
Whether to clamp the overview text (2-3 lines)
Features
- Rating Display
- Runtime (Movies)
- Seasons (TV Shows)
- Genres
Recommendation
Displays recommended and similar films with infinite scroll pagination.Props
Film ID to fetch recommendations for
Similar films data from API
Recommended films data from API
Section title (e.g., “You May Also Like”)
Implementation
The component first shows recommendations, then switches to similar films when recommendations are exhausted:Related Components
TitleLogo
Displays film logo or fallback title text
ImagePovi
Image wrapper with fallback and loading states
User Actions
Watchlist, favorite, and rating buttons
Search Integration
Filter and search components