Course Card

Course preview card

Marketing BlockEducation

Overview

Displays course information in a card layout. When href is provided, the entire card is wrapped in an anchor tag. Supports custom border radius, border color, and shadow via Tailwind class props.

Usage

import { CourseCard } from '@leanicon/web-builder-library'

Default

Card with image, category, level, duration, and price.

With instructor

Add instructor to show an avatar, name, and title below the description.

With tags

Add tags to render badge pills below the description.

Without image

Card renders without the hero image when image is omitted.

Instructor without avatar

When avatar is omitted, initials are shown as fallback.

UX research course cover
DesignBeginner

UX Research Fundamentals

Learn how to conduct user interviews and usability tests.

SC
Sarah ChenLead UX Researcher
6h 15m$39

Minimal

Only the required title — no image, description, badges, instructor, or footer.

Introduction to CSS Grid

Free course (no duration)

TypeScript course cover
EngineeringBeginner

Getting Started with TypeScript

A quick introduction to TypeScript for JavaScript developers.

Free

Custom border radius

Pass a Tailwind border-radius class via borderRadius.

Custom border color

Pass a Tailwind border-color class via borderColor.

Custom shadow

Pass a Tailwind shadow class via shadow.

Sharp corners, no shadow

Dark mode

With instructor — dark mode

With tags — dark mode

Minimal — dark mode

Introduction to CSS Grid

Instructor without avatar — dark mode

UX research course cover
DesignBeginner

UX Research Fundamentals

Learn how to conduct user interviews and usability tests.

SC
Sarah ChenLead UX Researcher
6h 15m$39

Props

CourseCard

Prop

Type

Default

Description

course

Course

—

Course data object (required)

borderRadius

string?

—

Tailwind border-radius class (e.g. "")

borderColor

string?

—

Tailwind border-color class (e.g. "border-primary")

shadow

string?

—

Tailwind shadow class (e.g. "shadow-lg")

colorScheme

"light" | "dark"

—

Force light or dark mode

className

string

—

Additional CSS classes on root

Course

Field

Type

Description

title

string

Course title (required)

description

string?

Short description (clamped to 2 lines)

image

ImageProps?

Hero image

href

string?

Link destination — wraps entire card in anchor

instructor

CourseInstructor?

Instructor info with avatar fallback

duration

string?

Duration text (e.g. "4h 30m")

level

string?

Level badge (e.g. "Beginner", "Advanced")

category

string?

Category badge

tags

string[]?

Tag badges below description

price

string?

Price text (e.g. "$49", "Free")

CourseInstructor

Field

Type

Description

name

string

Instructor name (required)

avatar

ImageProps?

Avatar image — initials shown as fallback

title

string?

Role/title beneath the name

Notes

  • course.href makes the entire card a clickable link; without it the card is non-interactive.
  • category and level render as badges above the title.
  • tags render as outline badges below the description.
  • Instructor initials are derived from the first letter of each word in the name (max 2 characters).
  • borderRadius, borderColor, and shadow accept any Tailwind utility class for full customization.
  • Dark mode: pass colorScheme="dark" or place inside a .dark ancestor.

Props

NameTypeDefaultRequiredDescription
courseCourse—Yes
borderRadiusstring—NoTailwind border-radius class, e.g. "", ""
borderColorstring—NoTailwind border-color class, e.g. "border-primary", "border-red-500"
shadowstring—NoTailwind shadow class, e.g. "shadow-lg", "shadow-none"
colorSchemeenum—No
classNamestring—No