Stories

A carousel of friends' stories, in video, image or avatar format.

Installation

npx love-ui@latest add stories

Usage

import { Stories, StoriesContent, Story, StoryVideo, StoryImage, StoryAuthor, StoryAuthorImage, StoryAuthorName, StoryTitle, StoryOverlay } from "@/components/stories"
<Stories>
  <StoriesContent>
    {stories.map((story) => (
      <Story key={story.id}>
        <StoryImage src={story.image} alt={story.title} />
        <StoryOverlay>
          <StoryAuthor>
            <StoryAuthorImage src={story.author.avatar} fallback={story.author.name} />
            <StoryAuthorName>{story.author.name}</StoryAuthorName>
          </StoryAuthor>
          <StoryTitle>{story.title}</StoryTitle>
        </StoryOverlay>
      </Story>
    ))}
  </StoriesContent>
</Stories>

Features

  • Composable Stories carousel with smooth scrolling
  • Built-in video and image support with proper aspect ratios
  • Author information with avatar and name display
  • Overlay components for titles and interactive elements
  • Multiple aspect ratio options (portrait, square, landscape)
  • Hover effects and focus states for accessibility
  • Touch and drag support via Embla Carousel
  • Optimized for mobile and desktop experiences

Examples

Story Images

Story Avatars