1 GitHub star = 1 new component.

Star the repo
Cards cardkanbantask

Kanban Task Card

Agile task card with priority labels and due dates.

Live Preview

Medium 65%

Optimize dynamic route code-splitting and asset prefetching

Usage

Copy and paste this code into your Astro page:

astro
---
import { KanbanTaskCard } from 'astro-component-kit';
---

<TaskKanbanCard task="Update SEO metadata" date="Oct 24" assigneeInitials="MJ" priority="high" />
--- import { KanbanTaskCard } from 'astro-component-kit'; --- <TaskKanbanCard task="Update SEO metadata" date="Oct 24" assigneeInitials="MJ" priority="high" />

Manual Installation

If you are not using the npm package, create a new file and paste the following code: src/components/lib/KanbanTaskCard.astro:

astro
---
/**
 * TaskKanbanCard — Agile task card with priority labels, progress completion bar, and due date.
 * 
 * @param {string} task - The description of the task being managed.
 * @param {string} date - Visual date string indicator (e.g. 'Oct 28').
 * @param {string} assigneeInitials - Short initials for the user avatar (e.g. 'MJ').
 * @param {'low'|'med'|'high'} priority - Priority tag variant. Default is 'med'.
 * @param {number} progress - Task completion percentage (0 - 100). Default is 65.
 */
interface Props {
  task?: string;
  date?: string;
  assigneeInitials?: string;
  priority?: 'low' | 'med' | 'high';
  progress?: number;
}

const {
  task = 'Optimize dynamic route code-splitting and asset prefetching',
  date = 'Oct 28',
  assigneeInitials = 'MJ',
  priority = 'med',
  progress = 65,
} = Astro.props;

const priorityLabels = { low: 'Low', med: 'Medium', high: 'High' };
---

<div class="task-card" role="article" aria-label={`Task: ${task}`}>
  <div class="task-card__tags">
    <span class={`task-card__tag task-card__tag--${priority}`}>
      <span class="task-card__tag-dot" aria-hidden="true"></span>
      {priorityLabels[priority]}
    </span>
    <span class="task-card__pct">{progress}%</span>
  </div>

  <p class="task-card__desc">{task}</p>

  <div class="task-card__progress-wrap" role="progressbar" aria-valuenow={progress} aria-valuemin="0" aria-valuemax="100" aria-label="Task progress">
    <div class="task-card__progress-bar" style={`width: ${progress}%;`}></div>
  </div>

  <div class="task-card__footer">
    <div class="task-card__date">
      <svg class="task-card__date-icon" width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
        <rect x="3" y="4" width="18" height="18" rx="2" ry="2"></rect>
        <line x1="16" y1="2" x2="16" y2="6"></line>
        <line x1="8" y1="2" x2="8" y2="6"></line>
        <line x1="3" y1="10" x2="21" y2="10"></line>
      </svg>
      <span>{date}</span>
    </div>

    <div class="task-card__assignee" title={`Assigned to ${assigneeInitials}`}>
      {assigneeInitials}
    </div>
  </div>
</div>

<style>
  .task-card {
    background: rgba(30, 41, 59, 0.7);
    backdrop-filter: blur(12px);
    padding: var(--sp-4, 1rem);
    border-radius: var(--r-md, 12px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    max-width: 320px;
    box-sizing: border-box;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  }

  .task-card:hover {
    transform: translateY(-2px);
    border-color: rgba(99, 102, 241, 0.35);
    box-shadow: 0 10px 24px -6px rgba(0, 0, 0, 0.5);
  }

  .task-card__tags {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .task-card__tag {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
  }

  .task-card__tag-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: currentColor;
  }

  .task-card__tag--high {
    background: rgba(239, 68, 68, 0.12);
    color: #f87171;
  }

  .task-card__tag--med {
    background: rgba(245, 158, 11, 0.12);
    color: #fbbf24;
  }

  .task-card__tag--low {
    background: rgba(52, 211, 153, 0.12);
    color: #34d399;
  }

  .task-card__pct {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--c-text-2, #94a3b8);
  }

  .task-card__desc {
    font-size: 0.88rem;
    color: var(--c-text-1, #f1f5f9);
    margin: 0;
    font-weight: 500;
    line-height: 1.45;
  }

  .task-card__progress-wrap {
    height: 4px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 2px;
    overflow: hidden;
  }

  .task-card__progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--c-primary, #6366f1), var(--c-primary-light, #818cf8));
    border-radius: 2px;
  }

  .task-card__footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 0.35rem;
  }

  .task-card__date {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    color: var(--c-text-2, #94a3b8);
  }

  .task-card__date-icon {
    opacity: 0.75;
  }

  .task-card__assignee {
    width: 24px;
    height: 24px;
    background: var(--c-primary, #6366f1);
    color: #fff;
    font-size: 0.65rem;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-weight: 800;
  }
</style>
--- /** * TaskKanbanCard — Agile task card with priority labels, progress completion bar, and due date. * * @param {string} task - The description of the task being managed. * @param {string} date - Visual date string indicator (e.g. 'Oct 28'). * @param {string} assigneeInitials - Short initials for the user avatar (e.g. 'MJ'). * @param {'low'|'med'|'high'} priority - Priority tag variant. Default is 'med'. * @param {number} progress - Task completion percentage (0 - 100). Default is 65. */ interface Props { task?: string; date?: string; assigneeInitials?: string; priority?: 'low' | 'med' | 'high'; progress?: number; } const { task = 'Optimize dynamic route code-splitting and asset prefetching', date = 'Oct 28', assigneeInitials = 'MJ', priority = 'med', progress = 65, } = Astro.props; const priorityLabels = { low: 'Low', med: 'Medium', high: 'High' }; --- <div class="task-card" role="article" aria-label={`Task: ${task}`}> <div class="task-card__tags"> <span class={`task-card__tag task-card__tag--${priority}`}> <span class="task-card__tag-dot" aria-hidden="true"></span> {priorityLabels[priority]} </span> <span class="task-card__pct">{progress}%</span> </div> <p class="task-card__desc">{task}</p> <div class="task-card__progress-wrap" role="progressbar" aria-valuenow={progress} aria-valuemin="0" aria-valuemax="100" aria-label="Task progress"> <div class="task-card__progress-bar" style={`width: ${progress}%;`}></div> </div> <div class="task-card__footer"> <div class="task-card__date"> <svg class="task-card__date-icon" width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"> <rect x="3" y="4" width="18" height="18" rx="2" ry="2"></rect> <line x1="16" y1="2" x2="16" y2="6"></line> <line x1="8" y1="2" x2="8" y2="6"></line> <line x1="3" y1="10" x2="21" y2="10"></line> </svg> <span>{date}</span> </div> <div class="task-card__assignee" title={`Assigned to ${assigneeInitials}`}> {assigneeInitials} </div> </div> </div> <style> .task-card { background: rgba(30, 41, 59, 0.7); backdrop-filter: blur(12px); padding: var(--sp-4, 1rem); border-radius: var(--r-md, 12px); border: 1px solid rgba(255, 255, 255, 0.08); display: flex; flex-direction: column; gap: 0.65rem; max-width: 320px; box-sizing: border-box; transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease; } .task-card:hover { transform: translateY(-2px); border-color: rgba(99, 102, 241, 0.35); box-shadow: 0 10px 24px -6px rgba(0, 0, 0, 0.5); } .task-card__tags { display: flex; justify-content: space-between; align-items: center; } .task-card__tag { font-size: 0.7rem; font-weight: 700; padding: 2px 8px; border-radius: 4px; display: inline-flex; align-items: center; gap: 4px; } .task-card__tag-dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; } .task-card__tag--high { background: rgba(239, 68, 68, 0.12); color: #f87171; } .task-card__tag--med { background: rgba(245, 158, 11, 0.12); color: #fbbf24; } .task-card__tag--low { background: rgba(52, 211, 153, 0.12); color: #34d399; } .task-card__pct { font-size: 0.72rem; font-weight: 700; color: var(--c-text-2, #94a3b8); } .task-card__desc { font-size: 0.88rem; color: var(--c-text-1, #f1f5f9); margin: 0; font-weight: 500; line-height: 1.45; } .task-card__progress-wrap { height: 4px; background: rgba(255, 255, 255, 0.08); border-radius: 2px; overflow: hidden; } .task-card__progress-bar { height: 100%; background: linear-gradient(90deg, var(--c-primary, #6366f1), var(--c-primary-light, #818cf8)); border-radius: 2px; } .task-card__footer { display: flex; justify-content: space-between; align-items: center; padding-top: 0.35rem; } .task-card__date { display: flex; align-items: center; gap: 4px; font-size: 0.75rem; color: var(--c-text-2, #94a3b8); } .task-card__date-icon { opacity: 0.75; } .task-card__assignee { width: 24px; height: 24px; background: var(--c-primary, #6366f1); color: #fff; font-size: 0.65rem; border-radius: 50%; display: grid; place-items: center; font-weight: 800; } </style>

Quick Info

Category
Cards
Filename
KanbanTaskCard.astro
Dependencies
None — pure Astro + CSS
Tags
cardkanbantask