Staaarter

Video Lesson Hero

Video lesson hero section pairing course info (title, instructor, duration) with a video thumbnail and a decorative centered play button overlay, plus a short previous/next lesson navigation row below.

By Staaarter Team
Education
Docs
Live preview

Docs

Installation

A real shadcn registry command, not a copy-paste stand-in: it fetches this block plus its badge, media-slot dependencies and any missing npm packages, and installs them straight into your project.

npx shadcn add https://staaarter.com/r/video-lesson-hero.json

Prefer not to use the CLI? Copy the source from the Code toggle above into src/components/blocks/education/education15.tsx instead.

Usage

The file also exports education15Demo, the exact props behind the preview above. Spread it to get a working section in one line, then replace it with your own data.

import { Education15, education15Demo } from "@/components/blocks/education/education15";

export default function Page() {
  return <Education15 {...education15Demo} />;
}

Props

PropTypeDefaultDescription
badge{ label: string; variant?: BadgeVariant }nonePill above the heading; only rendered when badge is truthy.
headingReactNodenoneLesson title.
instructorstringnoneInstructor name shown under the heading.
durationstringnoneLesson duration, e.g. "18 min".
descriptionstringundefinedSupporting copy under the heading.
thumbnail{ src: string; alt: string }noneVideo thumbnail image behind the decorative play button.
navItemsLessonNavItem[][]Up to a previous/next pair rendered below the hero; first entry aligns left, second aligns right.
classNamestringnoneExtra classes for the outer section element.

Types

type LessonNavItem = {
  label: string;
  title: string;
  href?: string;
};

Behavior notes

  • The play button centered over the thumbnail is entirely decorative: there's no real video, no play state, and (since this is a Server Component) no onClick handler attached to it at all.
  • navItems renders each entry as a next/link anchor when href is set, or as a plain non-interactive card when it isn't; the component itself performs no lesson navigation logic.
  • The first navItems entry is styled to align left (assumed 'previous'), the second to align right (assumed 'next'); passing more than two entries will just left-align every one after the first.
  • duration is a plain pre-formatted string, not computed from real video metadata.