Skip to content
Native Animation
Course Glass Carousel animation preview

This preview uses fictional demo content. See the props below for the customization options available in this component.

npx nativeanimation add course-glass-carousel
CarouselGlass

Course Glass Carousel

A glass course carousel with a swipe-synced photo backdrop and configurable course data, fonts, tint, and background color.

$9 for this animation

Add to your project

Copy the component and its assets into your app with the Native Animation CLI, or paste the agent prompt into Claude Code, Codex or Cursor once the MCP server is connected.

About this animation

A glass course carousel with a swipe-synced photo backdrop and configurable course data, fonts, tint, and background color.

Why this one

The active course cover also becomes the ambient light source for the upper screen, so changing courses recolors the whole scene. A featured lesson card, filter row, glass navigation dock, and progress segment complete the course dashboard.

How it works

  1. Measure the container and derive the card width from the available space.
  2. Track horizontal pans with a shared fractional index and spring to the nearest course on release.
  3. Derive each card’s position and depth from its distance to that index.
  4. Animate the filter and bottom navigation indicators with independent shared values; taps request the same selections as gestures.

Install

npx expo install @expo/vector-icons react-native-gesture-handler react-native-reanimated react-native-worklets

Usage

import { useRef } from 'react';
import CourseGlassCarousel, { type CourseGlassCarouselRef } from './CourseGlassCarousel';

export function CoursesScreen() {
  const carousel = useRef<CourseGlassCarouselRef>(null);
  return <CourseGlassCarousel ref={carousel} courses={courses} featured={featured} />;
}

Call next(), previous(), or setSegment(index) through the ref. The card pan and all background layers use one continuous shared index.

Props

PropDescription
coursesCourse IDs, titles, images, duration, rating, lesson counts, parts, and learner labels.
featuredFeatured lower card title, image, and learner label.
tabsLower filter labels and counts.
segmentsThe two glass segment labels.
avatarProfile image used by the profile and learner stacks.
colorsOptional pink tint and lower background colors.
onContinueCalled with the active course ID.
onCourseChangeCalled with the settled course index and ID.
onTabChangeCalled with the selected lower tab index.
fontFamily, mediumFontFamily, boldFontFamilyOptional UI font family names.
style, testIDRoot view style and test identifier.

Layout

Card content uses a 16 pt inset, with 4/8 pt spacing for metadata and section gaps. The segment thumb travels exactly one option width, and filter counts sit above the label baseline with a separate gap. The featured artwork uses 54% of its row; the title has room for three lines.

The screen reserves 88 pt below its content viewport for the 56 pt navigation dock, a 16 pt bottom inset, and a 16 pt content gap. Short containers scroll above the dock without a visible scroll indicator. Content width is capped at 430 pt on tablets and in landscape. The host screen supplies system safe area insets.

Compatibility

  • Expo SDK 58 and React Native 0.88
  • Reanimated 4.7, Worklets 0.13, and Gesture Handler 3
  • iOS, Android, and web supported.

Accessibility

Course actions expose button roles and a title-based Continue label; navigation exposes selected states. Cards can be selected without dragging. Reduced motion replaces spring travel with immediate selection updates. The host owns safe-area insets and supplies the course content and fonts.