Kanban board
A three-column task board: drag cards between columns with a tilting ghost and a drop slot that opens where the card will land, or move them by keyboard.
"use client";
import {
useEffect,
useRef,
useState,
type CSSProperties,
type KeyboardEvent,
type PointerEvent as ReactPointerEvent,
} from "react";
import "./kanban-board.css";
type Card = {
id: string;
title: string;
tag: string;
tone: string;
who: string;
};
type Col = { id: string; title: string; cards: Card[] };
const START: Col[] = [
{
id: "todo",
title: "To do",
cards: [
{
id: "1",
title: "Write launch email",
tag: "Marketing",
tone: "#ff5a1f",
who: "MC",
},
{
id: "2",
title: "Fix mobile nav overlap",
tag: "Bug",
tone: "#dc2626",
who: "LP",
},
{
id: "3",
title: "Pricing page copy review",
tag: "Content",
tone: "#2b35ff",
who: "AS",
},
],
},
{
id: "doing",
title: "In progress",
cards: [
{
id: "4",
title: "Onboarding checklist UI",
tag: "Design",
tone: "#a8896b",
who: "MC",
},
{
id: "5",
title: "Stripe webhooks",
tag: "Backend",
tone: "#5f7060",
who: "SO",
},
],
},
{
id: "done",
title: "Done",
cards: [
{
id: "6",
title: "New logo files",
tag: "Brand",
tone: "#d7ff3a",
who: "AS",
},
],
},
];
type Drag = {
card: Card;
from: string;
x: number;
y: number;
ox: number;
oy: number;
w: number;
to: string;
index: number;
};
/**
* KanbanBoard
* - Pointer-based drag (works for mouse, pen and touch): a fixed-position ghost follows the pointer and
* the drop target (column + index) is computed from card midpoints under the pointer.
* - Touch needs a 180ms press before dragging so normal scrolling still works.
* - Keyboard: focus a card, press Space to pick it up, arrows to move, Space to drop, Escape to cancel.
*/
export function KanbanBoard({ theme = "light" }: { theme?: "light" | "dark" }) {
const [cols, setCols] = useState(START);
const [drag, setDrag] = useState<Drag | null>(null);
const [held, setHeld] = useState<string | null>(null); // keyboard "picked up" card id
const [msg, setMsg] = useState("");
const board = useRef<HTMLDivElement>(null);
const press = useRef<{
t: number;
e: { x: number; y: number };
card: Card;
from: string;
el: HTMLElement;
} | null>(null);
const move = (cardId: string, to: string, index: number) =>
setCols((cs) => {
const card = cs.flatMap((c) => c.cards).find((c) => c.id === cardId)!;
const stripped = cs.map((c) => ({
...c,
cards: c.cards.filter((x) => x.id !== cardId),
}));
return stripped.map((c) =>
c.id === to
? {
...c,
cards: [
...c.cards.slice(0, index),
card,
...c.cards.slice(index),
],
}
: c,
);
});
const target = (x: number, y: number) => {
const colEls =
board.current?.querySelectorAll<HTMLElement>("[data-col]") ?? [];
for (const el of colEls) {
const r = el.getBoundingClientRect();
if (x >= r.left && x <= r.right) {
const cards = [
...el.querySelectorAll<HTMLElement>(
"[data-card]:not([data-dragging])",
),
];
const index = cards.filter(
(c) => c.getBoundingClientRect().top + c.offsetHeight / 2 < y,
).length;
return { to: el.dataset.col!, index };
}
}
return null;
};
const begin = (
x: number,
y: number,
card: Card,
from: string,
el: HTMLElement,
) => {
const r = el.getBoundingClientRect();
const t = target(x, y) ?? { to: from, index: 0 };
setDrag({
card,
from,
x,
y,
ox: x - r.left,
oy: y - r.top,
w: r.width,
...t,
});
};
const onDown = (
e: ReactPointerEvent<HTMLElement>,
card: Card,
from: string,
) => {
if (e.button !== 0) return;
const el = e.currentTarget;
if (e.pointerType === "mouse") {
e.preventDefault();
begin(e.clientX, e.clientY, card, from, el);
} else
press.current = {
t: window.setTimeout(
() =>
press.current &&
begin(press.current.e.x, press.current.e.y, card, from, el),
180,
),
e: { x: e.clientX, y: e.clientY },
card,
from,
el,
};
};
useEffect(() => {
const cancelPress = (e: PointerEvent) => {
const p = press.current;
if (p && Math.hypot(e.clientX - p.e.x, e.clientY - p.e.y) > 8) {
clearTimeout(p.t);
press.current = null; // the finger moved first: it's a scroll, not a drag
}
};
const up = () => {
if (press.current) clearTimeout(press.current.t);
press.current = null;
};
addEventListener("pointermove", cancelPress);
addEventListener("pointerup", up);
return () => {
removeEventListener("pointermove", cancelPress);
removeEventListener("pointerup", up);
};
}, []);
useEffect(() => {
if (!drag) return;
const onMove = (e: PointerEvent) => {
const t = target(e.clientX, e.clientY);
setDrag((d) =>
d ? { ...d, x: e.clientX, y: e.clientY, ...(t ?? {}) } : d,
);
};
const onUp = () => {
move(drag.card.id, drag.to, drag.index);
setMsg(
`${drag.card.title} moved to ${cols.find((c) => c.id === drag.to)?.title}.`,
);
setDrag(null);
};
// Stop the page from scrolling under a finger that is dragging a card
const noScroll = (e: TouchEvent) => e.preventDefault();
addEventListener("pointermove", onMove);
addEventListener("pointerup", onUp);
addEventListener("pointercancel", onUp);
addEventListener("touchmove", noScroll, { passive: false });
return () => {
removeEventListener("pointermove", onMove);
removeEventListener("pointerup", onUp);
removeEventListener("pointercancel", onUp);
removeEventListener("touchmove", noScroll);
};
}, [drag, cols]);
const onKey = (
e: KeyboardEvent<HTMLElement>,
card: Card,
colIndex: number,
index: number,
) => {
if (e.key === " " || e.key === "Enter") {
e.preventDefault();
setHeld((h) => (h === card.id ? null : card.id));
setMsg(
held === card.id
? `${card.title} dropped in ${cols[colIndex].title}.`
: `${card.title} picked up. Use arrow keys to move, Space to drop.`,
);
return;
}
if (e.key === "Escape") return setHeld(null);
if (held !== card.id) return;
const dirs: Record<string, [number, number]> = {
ArrowLeft: [-1, 0],
ArrowRight: [1, 0],
ArrowUp: [0, -1],
ArrowDown: [0, 1],
};
const d = dirs[e.key];
if (!d) return;
e.preventDefault();
const c = Math.max(0, Math.min(cols.length - 1, colIndex + d[0]));
const max = cols[c].cards.length - (c === colIndex ? 1 : 0);
const i = d[0]
? Math.min(index, max)
: Math.max(0, Math.min(max, index + d[1]));
move(card.id, cols[c].id, i);
setMsg(`${cols[c].title}, position ${i + 1}.`);
requestAnimationFrame(() =>
board.current
?.querySelector<HTMLElement>(`[data-card="${card.id}"]`)
?.focus(),
);
};
return (
<div
className="gu-kan"
data-theme={theme}
data-dragging={drag ? "" : undefined}
>
<div ref={board} className="gu-kan__board" data-lenis-prevent>
{cols.map((col, ci) => (
<section
key={col.id}
className="gu-kan__col"
data-col={col.id}
data-over={drag?.to === col.id ? "" : undefined}
aria-labelledby={`gu-kan-${col.id}`}
>
<h3 id={`gu-kan-${col.id}`}>
{col.title} <span>{col.cards.length}</span>
</h3>
<ul>
{col.cards.map((card, i) => {
const isDragged = drag?.card.id === card.id;
return (
<li key={card.id} className="gu-kan__slot">
{drag?.to === col.id && drag.index === i && !isDragged && (
<span className="gu-kan__drop" aria-hidden="true" />
)}
<article
className="gu-kan__card"
data-card={card.id}
data-dragging={isDragged ? "" : undefined}
data-held={held === card.id ? "" : undefined}
tabIndex={0}
aria-roledescription="Draggable card"
aria-label={`${card.title}, ${card.tag}, in ${col.title}`}
onPointerDown={(e) => onDown(e, card, col.id)}
onKeyDown={(e) => onKey(e, card, ci, i)}
style={{ "--tone": card.tone } as CSSProperties}
>
<span className="gu-kan__tag">{card.tag}</span>
<b>{card.title}</b>
<span className="gu-kan__who" aria-hidden="true">
{card.who}
</span>
</article>
</li>
);
})}
{drag?.to === col.id &&
drag.index >=
col.cards.filter((c) => c.id !== drag.card.id).length && (
<li className="gu-kan__slot">
<span className="gu-kan__drop" aria-hidden="true" />
</li>
)}
</ul>
</section>
))}
</div>
{drag && (
<article
className="gu-kan__card gu-kan__ghost"
style={
{
left: drag.x - drag.ox,
top: drag.y - drag.oy,
width: drag.w,
"--tone": drag.card.tone,
} as CSSProperties
}
aria-hidden="true"
>
<span className="gu-kan__tag">{drag.card.tag}</span>
<b>{drag.card.title}</b>
<span className="gu-kan__who">{drag.card.who}</span>
</article>
)}
<p className="gu-sr" aria-live="assertive">
{msg}
</p>
<p className="gu-kan__hint">
Drag cards between columns. Keyboard: focus a card, Space to pick up,
arrows to move, Space to drop.
</p>
</div>
);
}
Paste this into ChatGPT, Claude, Cursor, v0, Lovable or Bolt. It describes the layout, motion, colors and accessibility and includes the code, so the AI can rebuild it in any framework.
# Build this UI piece: Kanban board
You are a senior front-end engineer. Recreate the piece below in my project. If I don't say which framework I use, ask once, then build it in that framework (React, Vue, Svelte, Angular, Astro, plain HTML/CSS/JS or anything else). Keep the behavior, motion, colors, spacing and accessibility exactly as described. Keep the code clean and commented for beginners.
## What it is
A three-column kanban board (To do, In progress, Done). Drag a card and a tilted ghost follows the pointer while a dashed orange slot opens exactly where it will land; the column under the pointer gets an orange outline. Keyboard users pick a card up with Space and move it with the arrows.
## Layout and look
- Columns min 240px, radius 22px, tinted background (#ece6d9, dark #141416), title (weight 900) with a count pill. On phones the board scrolls sideways with snap.
- Cards: radius 16px, card background, hairline border; a small tag pill tinted with the card's color, a bold title, and a 26px Ink initials avatar top-right. Hover adds a soft shadow.
- Dragging: the original fades to 25%; the ghost is fixed-position, rotated 3°, scaled 1.04 with a deep shadow; the drop slot is a 64px dashed orange box that grows open.
- Keyboard "held" card: orange ring, rotate −1.5°.
## Behavior and motion
1. Pointer events: mouse starts dragging immediately; touch needs a 180ms press without moving (moving first = scroll).
2. Drop target = column under the pointer X, index = number of cards whose midpoint is above the pointer Y.
3. On release, move the card in state and announce "Write launch email moved to Done."
4. Keyboard: Space/Enter picks up or drops; arrows move between columns and positions; Escape cancels; focus follows the card.
## Accessibility
- Cards are focusable with aria-roledescription "Draggable card" and a label with their column; an assertive live region announces moves.
- prefers-reduced-motion: no tilt or slot animation.
## Props
theme. Replace START with your data and save moves to your backend.
## Reference implementation
The original is written in React with one plain CSS file. Dependencies: none (plain React and CSS). Translate it faithfully; do not add new libraries unless my framework needs them.
### KanbanBoard.tsx
```tsx
"use client";
import {
useEffect,
useRef,
useState,
type CSSProperties,
type KeyboardEvent,
type PointerEvent as ReactPointerEvent,
} from "react";
import "./kanban-board.css";
type Card = {
id: string;
title: string;
tag: string;
tone: string;
who: string;
};
type Col = { id: string; title: string; cards: Card[] };
const START: Col[] = [
{
id: "todo",
title: "To do",
cards: [
{
id: "1",
title: "Write launch email",
tag: "Marketing",
tone: "#ff5a1f",
who: "MC",
},
{
id: "2",
title: "Fix mobile nav overlap",
tag: "Bug",
tone: "#dc2626",
who: "LP",
},
{
id: "3",
title: "Pricing page copy review",
tag: "Content",
tone: "#2b35ff",
who: "AS",
},
],
},
{
id: "doing",
title: "In progress",
cards: [
{
id: "4",
title: "Onboarding checklist UI",
tag: "Design",
tone: "#a8896b",
who: "MC",
},
{
id: "5",
title: "Stripe webhooks",
tag: "Backend",
tone: "#5f7060",
who: "SO",
},
],
},
{
id: "done",
title: "Done",
cards: [
{
id: "6",
title: "New logo files",
tag: "Brand",
tone: "#d7ff3a",
who: "AS",
},
],
},
];
type Drag = {
card: Card;
from: string;
x: number;
y: number;
ox: number;
oy: number;
w: number;
to: string;
index: number;
};
/**
* KanbanBoard
* - Pointer-based drag (works for mouse, pen and touch): a fixed-position ghost follows the pointer and
* the drop target (column + index) is computed from card midpoints under the pointer.
* - Touch needs a 180ms press before dragging so normal scrolling still works.
* - Keyboard: focus a card, press Space to pick it up, arrows to move, Space to drop, Escape to cancel.
*/
export function KanbanBoard({ theme = "light" }: { theme?: "light" | "dark" }) {
const [cols, setCols] = useState(START);
const [drag, setDrag] = useState<Drag | null>(null);
const [held, setHeld] = useState<string | null>(null); // keyboard "picked up" card id
const [msg, setMsg] = useState("");
const board = useRef<HTMLDivElement>(null);
const press = useRef<{
t: number;
e: { x: number; y: number };
card: Card;
from: string;
el: HTMLElement;
} | null>(null);
const move = (cardId: string, to: string, index: number) =>
setCols((cs) => {
const card = cs.flatMap((c) => c.cards).find((c) => c.id === cardId)!;
const stripped = cs.map((c) => ({
...c,
cards: c.cards.filter((x) => x.id !== cardId),
}));
return stripped.map((c) =>
c.id === to
? {
...c,
cards: [
...c.cards.slice(0, index),
card,
...c.cards.slice(index),
],
}
: c,
);
});
const target = (x: number, y: number) => {
const colEls =
board.current?.querySelectorAll<HTMLElement>("[data-col]") ?? [];
for (const el of colEls) {
const r = el.getBoundingClientRect();
if (x >= r.left && x <= r.right) {
const cards = [
...el.querySelectorAll<HTMLElement>(
"[data-card]:not([data-dragging])",
),
];
const index = cards.filter(
(c) => c.getBoundingClientRect().top + c.offsetHeight / 2 < y,
).length;
return { to: el.dataset.col!, index };
}
}
return null;
};
const begin = (
x: number,
y: number,
card: Card,
from: string,
el: HTMLElement,
) => {
const r = el.getBoundingClientRect();
const t = target(x, y) ?? { to: from, index: 0 };
setDrag({
card,
from,
x,
y,
ox: x - r.left,
oy: y - r.top,
w: r.width,
...t,
});
};
const onDown = (
e: ReactPointerEvent<HTMLElement>,
card: Card,
from: string,
) => {
if (e.button !== 0) return;
const el = e.currentTarget;
if (e.pointerType === "mouse") {
e.preventDefault();
begin(e.clientX, e.clientY, card, from, el);
} else
press.current = {
t: window.setTimeout(
() =>
press.current &&
begin(press.current.e.x, press.current.e.y, card, from, el),
180,
),
e: { x: e.clientX, y: e.clientY },
card,
from,
el,
};
};
useEffect(() => {
const cancelPress = (e: PointerEvent) => {
const p = press.current;
if (p && Math.hypot(e.clientX - p.e.x, e.clientY - p.e.y) > 8) {
clearTimeout(p.t);
press.current = null; // the finger moved first: it's a scroll, not a drag
}
};
const up = () => {
if (press.current) clearTimeout(press.current.t);
press.current = null;
};
addEventListener("pointermove", cancelPress);
addEventListener("pointerup", up);
return () => {
removeEventListener("pointermove", cancelPress);
removeEventListener("pointerup", up);
};
}, []);
useEffect(() => {
if (!drag) return;
const onMove = (e: PointerEvent) => {
const t = target(e.clientX, e.clientY);
setDrag((d) =>
d ? { ...d, x: e.clientX, y: e.clientY, ...(t ?? {}) } : d,
);
};
const onUp = () => {
move(drag.card.id, drag.to, drag.index);
setMsg(
`${drag.card.title} moved to ${cols.find((c) => c.id === drag.to)?.title}.`,
);
setDrag(null);
};
// Stop the page from scrolling under a finger that is dragging a card
const noScroll = (e: TouchEvent) => e.preventDefault();
addEventListener("pointermove", onMove);
addEventListener("pointerup", onUp);
addEventListener("pointercancel", onUp);
addEventListener("touchmove", noScroll, { passive: false });
return () => {
removeEventListener("pointermove", onMove);
removeEventListener("pointerup", onUp);
removeEventListener("pointercancel", onUp);
removeEventListener("touchmove", noScroll);
};
}, [drag, cols]);
const onKey = (
e: KeyboardEvent<HTMLElement>,
card: Card,
colIndex: number,
index: number,
) => {
if (e.key === " " || e.key === "Enter") {
e.preventDefault();
setHeld((h) => (h === card.id ? null : card.id));
setMsg(
held === card.id
? `${card.title} dropped in ${cols[colIndex].title}.`
: `${card.title} picked up. Use arrow keys to move, Space to drop.`,
);
return;
}
if (e.key === "Escape") return setHeld(null);
if (held !== card.id) return;
const dirs: Record<string, [number, number]> = {
ArrowLeft: [-1, 0],
ArrowRight: [1, 0],
ArrowUp: [0, -1],
ArrowDown: [0, 1],
};
const d = dirs[e.key];
if (!d) return;
e.preventDefault();
const c = Math.max(0, Math.min(cols.length - 1, colIndex + d[0]));
const max = cols[c].cards.length - (c === colIndex ? 1 : 0);
const i = d[0]
? Math.min(index, max)
: Math.max(0, Math.min(max, index + d[1]));
move(card.id, cols[c].id, i);
setMsg(`${cols[c].title}, position ${i + 1}.`);
requestAnimationFrame(() =>
board.current
?.querySelector<HTMLElement>(`[data-card="${card.id}"]`)
?.focus(),
);
};
return (
<div
className="gu-kan"
data-theme={theme}
data-dragging={drag ? "" : undefined}
>
<div ref={board} className="gu-kan__board" data-lenis-prevent>
{cols.map((col, ci) => (
<section
key={col.id}
className="gu-kan__col"
data-col={col.id}
data-over={drag?.to === col.id ? "" : undefined}
aria-labelledby={`gu-kan-${col.id}`}
>
<h3 id={`gu-kan-${col.id}`}>
{col.title} <span>{col.cards.length}</span>
</h3>
<ul>
{col.cards.map((card, i) => {
const isDragged = drag?.card.id === card.id;
return (
<li key={card.id} className="gu-kan__slot">
{drag?.to === col.id && drag.index === i && !isDragged && (
<span className="gu-kan__drop" aria-hidden="true" />
)}
<article
className="gu-kan__card"
data-card={card.id}
data-dragging={isDragged ? "" : undefined}
data-held={held === card.id ? "" : undefined}
tabIndex={0}
aria-roledescription="Draggable card"
aria-label={`${card.title}, ${card.tag}, in ${col.title}`}
onPointerDown={(e) => onDown(e, card, col.id)}
onKeyDown={(e) => onKey(e, card, ci, i)}
style={{ "--tone": card.tone } as CSSProperties}
>
<span className="gu-kan__tag">{card.tag}</span>
<b>{card.title}</b>
<span className="gu-kan__who" aria-hidden="true">
{card.who}
</span>
</article>
</li>
);
})}
{drag?.to === col.id &&
drag.index >=
col.cards.filter((c) => c.id !== drag.card.id).length && (
<li className="gu-kan__slot">
<span className="gu-kan__drop" aria-hidden="true" />
</li>
)}
</ul>
</section>
))}
</div>
{drag && (
<article
className="gu-kan__card gu-kan__ghost"
style={
{
left: drag.x - drag.ox,
top: drag.y - drag.oy,
width: drag.w,
"--tone": drag.card.tone,
} as CSSProperties
}
aria-hidden="true"
>
<span className="gu-kan__tag">{drag.card.tag}</span>
<b>{drag.card.title}</b>
<span className="gu-kan__who">{drag.card.who}</span>
</article>
)}
<p className="gu-sr" aria-live="assertive">
{msg}
</p>
<p className="gu-kan__hint">
Drag cards between columns. Keyboard: focus a card, Space to pick up,
arrows to move, Space to drop.
</p>
</div>
);
}
```
### kanban-board.css
```css
/* KanbanBoard: change these colors to match your brand. */
.gu-kan {
--col: #ece6d9;
--card: #fbf8f2;
--text: #0e0e10;
--muted: #57534b;
--line: rgb(14 14 16 / 0.1);
--accent: #ff5a1f;
--focus: #2b35ff;
--ease: cubic-bezier(0.16, 1, 0.3, 1);
width: min(100%, 900px);
color: var(--text);
font-family: system-ui, sans-serif;
}
.gu-kan[data-theme="dark"] {
--col: #141416;
--card: #1f1f23;
--text: #f3eee3;
--muted: #aea89c;
--line: rgb(243 238 227 / 0.1);
--focus: #d7ff3a;
}
.gu-kan[data-dragging] {
cursor: grabbing;
user-select: none;
}
.gu-kan__board {
display: flex;
/* Size from the card, not the columns, so narrow screens scroll the board instead of widening the page */
contain: inline-size;
gap: 12px;
overflow-x: auto;
padding-bottom: 6px;
scroll-snap-type: x proximity;
}
.gu-kan__col {
flex: 1 0 240px;
display: grid;
align-content: start;
gap: 10px;
min-height: 340px;
padding: 12px;
border-radius: 22px;
background: var(--col);
scroll-snap-align: start;
transition: box-shadow 0.2s;
}
.gu-kan__col[data-over] {
box-shadow: inset 0 0 0 2px var(--accent);
}
.gu-kan__col h3 {
display: flex;
align-items: center;
gap: 8px;
margin: 2px 4px 0;
font-size: 0.95rem;
font-weight: 900;
}
.gu-kan__col h3 span {
padding: 1px 8px;
border-radius: 999px;
background: var(--line);
color: var(--muted);
font-size: 0.75rem;
}
.gu-kan ul {
display: grid;
gap: 8px;
margin: 0;
padding: 0;
list-style: none;
}
.gu-kan__slot {
display: grid;
gap: 8px;
}
.gu-kan__card {
position: relative;
display: grid;
grid-template-columns: 1fr auto;
gap: 8px 10px;
padding: 14px;
border: 1px solid var(--line);
border-radius: 16px;
background: var(--card);
cursor: grab;
touch-action: pan-y;
-webkit-touch-callout: none;
user-select: none;
transition:
transform 0.25s var(--ease),
box-shadow 0.25s,
opacity 0.2s;
}
.gu-kan__card:hover {
box-shadow: 0 10px 20px -14px rgb(0 0 0 / 0.4);
}
.gu-kan__card:focus-visible {
outline: 3px solid var(--focus);
outline-offset: 2px;
}
/* The original stays in place as a faded outline while its ghost is dragged */
.gu-kan__card[data-dragging] {
opacity: 0.25;
}
.gu-kan__card[data-held] {
box-shadow:
0 0 0 3px var(--accent),
0 16px 30px -16px rgb(0 0 0 / 0.45);
transform: rotate(-1.5deg) scale(1.02);
}
.gu-kan__tag {
justify-self: start;
padding: 2px 8px;
border-radius: 999px;
background: color-mix(in srgb, var(--tone) 22%, transparent);
font-size: 0.72rem;
font-weight: 800;
}
.gu-kan__card b {
grid-column: 1 / -1;
font-size: 0.95rem;
line-height: 1.3;
}
.gu-kan__who {
grid-row: 1;
grid-column: 2;
display: grid;
place-items: center;
width: 26px;
height: 26px;
border-radius: 50%;
background: var(--text);
color: var(--card);
font-size: 0.62rem;
font-weight: 900;
}
.gu-kan__ghost {
position: fixed;
z-index: 1000;
pointer-events: none;
box-shadow: 0 30px 50px -20px rgb(0 0 0 / 0.5);
transform: rotate(3deg) scale(1.04);
transition: none;
}
.gu-kan__drop {
display: block;
height: 64px;
border: 2px dashed var(--accent);
border-radius: 16px;
background: color-mix(in srgb, var(--accent) 8%, transparent);
animation: gu-kan-open 0.2s var(--ease);
}
@keyframes gu-kan-open {
from {
height: 0;
opacity: 0;
}
}
.gu-kan__hint {
margin: 10px 4px 0;
color: var(--muted);
font-size: 0.82rem;
}
.gu-sr {
position: absolute;
width: 1px;
height: 1px;
overflow: hidden;
clip-path: inset(50%);
}
@media (prefers-reduced-motion: reduce) {
.gu-kan__card,
.gu-kan__card[data-held],
.gu-kan__ghost {
transform: none;
transition: none;
}
.gu-kan__drop {
animation: none;
}
}
```
You might also want
Next piece: Lightbox gallerySnap carousel with progress
Components, intermediate
Swipe card stack
Components, advanced
3D tilt card
Components, intermediate