Docs
Installation
A real shadcn registry command, not a copy-paste stand-in: it fetches this block plus its button, badge dependencies and any missing npm packages, and installs them straight into your project.
npx shadcn add https://staaarter.com/r/class-schedule-hero.jsonPrefer not to use the CLI? Copy the source from the Code toggle above into src/components/blocks/fitness/fitness2.tsx instead.
Usage
The file also exports fitness2Demo, 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 { Fitness2, fitness2Demo } from "@/components/blocks/fitness/fitness2"; export default function Page() { return <Fitness2 {...fitness2Demo} />; }
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| badge | { label: string; variant?: BadgeVariant } | none | Pill above the heading; only rendered when badge is truthy. |
| heading | string | none | Hero headline. |
| description | string | undefined | Supporting copy under the heading. |
| classes | ClassItem[] | [] | Today's classes listed in the schedule card. |
| buttons | ButtonItem[] | [] | CTA buttons under the heading. |
| className | string | none | Extra classes for the outer section element. |
Types
type ClassItem = { name: string; time: string; instructor: string; spotsLeft: number; capacity: number; }; type ButtonItem = { label: string; href?: string; variant?: "default" | "secondary" | "outline" | "ghost" | "link" | "destructive"; };
Behavior notes
- The schedule card only renders when classes has at least one entry; the heading/description/buttons column always renders on its own.
- A class is shown as "Full" (outline badge) when spotsLeft is 0 or less, and as "N/capacity spots" (secondary badge) otherwise; this is computed from the two numbers, not a separate boolean flag.
- This is a page-section block (py-16 sm:py-24), not a full-viewport screen, so it can be dropped into a normal marketing page layout alongside other sections.
- View full schedule and Book a class are static links (render={<Link/>}) with no real booking flow behind them.
More Fitness Blocks
View all →Personal Trainer Profile
Trainer showcase with photo, certifications, rating, and client stats in a floating card.
Training Program Cards
Program grid with images, duration, frequency, skill level, and enrollment buttons.
Gym Location Finder
Location section with map preview, address, hours, parking, and public transit info.
Transformation Gallery
Before/after photo grid showcasing member transformations with weight loss stats and testimonial quotes.