Kinetic Card
A content card with an eyebrow, title, text and action. Set interactive or href to make the whole card a link or button with a hover tilt.
- <kt-kinetic-card>
- Display
- No framework
The code
Copy the Kinetic Card
Fastest: press Copy on the card above for one complete file. To build it into your own
project, use the files below: the markup, the styles, this component’s script and the shared
effects script (effects.js) that every component uses.
<kt-kinetic-card eyebrow="Guide" title="Getting started" action="Read the guide" interactive>Install the library, add your first component and tune the look to your brand in about five minutes.</kt-kinetic-card>
<kt-kinetic-card eyebrow="Changelog" title="What is new in 2.4" action="See changes" href="/ui/card">Faster rendering, three new components and better keyboard support across the board.</kt-kinetic-card>
<kt-kinetic-card eyebrow="Pro tip" title="Keep it accessible" action="Learn more">Every component ships with roles, labels and visible focus, so you do not have to add them yourself.</kt-kinetic-card>
kt-kinetic-card {
display: block;
width: 100%;
max-width: 340px;
}
.kt-card {
--_color: var(--kt-accent);
--_ink: var(--kt-accent-ink);
--mx: 50%;
--my: 50%;
--rx: 0deg;
--ry: 0deg;
position: relative;
display: flex;
flex-direction: column;
align-items: flex-start;
gap: 8px;
box-sizing: border-box;
width: 100%;
margin: 0;
padding: 18px;
text-align: left;
text-decoration: none;
font-family: var(--font-sans);
color: var(--kt-surface-ink);
border-radius: var(--kt-surface-radius);
border-style: solid;
border-width: var(--kt-card-border-w);
border-color: var(--kt-comp-border, var(--kt-surface-border));
background: var(--kt-surface-bg);
box-shadow: var(--kt-comp-shadow);
overflow: hidden;
isolation: isolate;
-webkit-tap-highlight-color: transparent;
transition: transform 220ms ease, border-color 160ms ease, box-shadow 220ms ease;
}
.kt-card > span { position: relative; z-index: 1; display: block; }
.kt-card [hidden] { display: none; }
.kt-card-eyebrow {
font-family: var(--font-mono);
font-size: 10px;
font-weight: 700;
letter-spacing: 0.08em;
text-transform: uppercase;
line-height: 1.2;
color: var(--kt-surface-muted);
}
.kt-card-title {
font-size: 17px;
font-weight: 650;
letter-spacing: -0.015em;
line-height: 1.25;
}
.kt-card-body {
font-size: 13px;
line-height: 1.55;
color: var(--kt-surface-muted);
}
.kt-card-action-slot { margin-top: 6px; }
.kt-card-action {
display: inline-flex;
align-items: center;
gap: 6px;
min-height: 28px;
padding: 0 2px;
border: 0;
background: none;
font: inherit;
font-size: 13px;
font-weight: 600;
color: var(--kt-surface-ink);
cursor: pointer;
border-bottom: 2px solid var(--_color);
border-radius: 0;
transition: gap 160ms ease;
}
button.kt-card-action:focus-visible,
.kt-card:focus-visible {
outline: 2px solid var(--bw-ink);
outline-offset: 3px;
}
.kt-card-spot {
position: absolute !important;
inset: 0;
z-index: 0 !important;
pointer-events: none;
opacity: 0;
background: radial-gradient(220px circle at var(--mx) var(--my), color-mix(in srgb, var(--_color) 20%, transparent), transparent 70%);
transition: opacity 200ms ease;
}
[data-vfx="enterprise"] .kt-card-spot { display: none; }
/* interactive */
.kt-card[data-interactive] {
cursor: pointer;
user-select: none;
transform: perspective(800px) rotateX(var(--rx)) rotateY(var(--ry));
}
.kt-card[data-interactive]:hover { border-color: var(--kt-comp-border, var(--_color)); }
.kt-card[data-interactive]:hover .kt-card-spot { opacity: 1; }
.kt-card[data-interactive]:hover .kt-card-action { gap: 10px; }
.kt-card[data-interactive]:active { transform: perspective(800px) translateY(1px) scale(0.995); transition-duration: 80ms; }
[data-vfx="enterprise"] .kt-card[data-interactive] { transform: none; }
[data-vfx="enterprise"] .kt-card[data-interactive]:hover { box-shadow: 0 6px 18px -8px rgba(0, 0, 0, 0.35); }
[data-vfx="sakuga"] .kt-card[data-interactive]:hover,
[data-vfx="elastic"] .kt-card[data-interactive]:hover,
[data-vfx="ink"] .kt-card[data-interactive]:hover,
[data-vfx="glitch"] .kt-card[data-interactive]:hover,
[data-vfx="neon"] .kt-card[data-interactive]:hover {
transform: perspective(800px) translateY(-4px) rotateX(var(--rx)) rotateY(var(--ry));
box-shadow: 0 14px 28px -14px rgba(0, 0, 0, 0.45);
}
[data-vfx="elastic"] .kt-card[data-interactive] { transition-timing-function: cubic-bezier(0.34, 1.56, 0.64, 1); }
[data-vfx="glitch"] .kt-card[data-interactive]:hover { box-shadow: 4px 4px 0 -1px color-mix(in srgb, var(--_color) 80%, transparent); }
[data-vfx="neon"] .kt-card[data-interactive]:hover {
box-shadow: 0 0 24px -4px color-mix(in srgb, var(--_color) 70%, transparent);
}
@media (prefers-reduced-motion: reduce) {
.kt-card,
[data-vfx] .kt-card[data-interactive],
[data-vfx] .kt-card[data-interactive]:hover,
[data-vfx] .kt-card[data-interactive]:active { transform: none; transition: none; }
.kt-card-spot { display: none; }
}
class KtKineticCard extends HTMLElement {
static get observedAttributes() {
return ["title", "eyebrow", "action", "href", "interactive"];
}
constructor() {
super();
this._rendered = false;
this._text = "";
this._raf = null;
}
connectedCallback() {
if (!this._rendered) {
this._text = this.textContent.trim();
this.render();
this._rendered = true;
}
this.syncAttributes();
}
disconnectedCallback() {
if (this._raf) cancelAnimationFrame(this._raf);
this._raf = null;
}
attributeChangedCallback() {
if (this._rendered) this.syncAttributes();
}
get cardTitle() { return this.getAttribute("title") || ""; }
get eyebrow() { return this.getAttribute("eyebrow") || ""; }
get action() { return this.getAttribute("action") || ""; }
get href() { return this.getAttribute("href") || ""; }
get interactive() { return this.hasAttribute("interactive") && this.getAttribute("interactive") !== "false"; }
get text() { return this._text; }
render() {
this.innerHTML = "";
this._build();
}
// The root element depends on the mode: link, button, or plain article.
_build() {
const href = this.href;
const whole = href || this.interactive;
const root = document.createElement(href ? "a" : whole ? "button" : "article");
if (href) root.href = href;
else if (whole) root.type = "button";
root.className = "kt-card";
root.innerHTML = `
<span class="kt-card-spot" aria-hidden="true"></span>
<span class="kt-card-eyebrow"></span>
<span class="kt-card-title"></span>
<span class="kt-card-body"></span>
<span class="kt-card-action-slot"></span>
`;
this._root = root;
this._whole = !!whole;
this._mode = href ? "a" : whole ? "button" : "article";
this._eyebrowEl = root.querySelector(".kt-card-eyebrow");
this._titleEl = root.querySelector(".kt-card-title");
this._bodyEl = root.querySelector(".kt-card-body");
this._slot = root.querySelector(".kt-card-action-slot");
if (whole) {
root.addEventListener("click", (e) => this.fire(e.clientX, e.clientY, e.detail === 0));
root.addEventListener("pointermove", (e) => this.tilt(e));
root.addEventListener("pointerleave", () => this.untilt());
root.addEventListener("blur", () => this.untilt());
}
this.appendChild(root);
}
syncAttributes() {
const mode = this.href ? "a" : this.interactive ? "button" : "article";
if (mode !== this._mode) {
this.render();
}
const r = this._root;
r.toggleAttribute("data-interactive", this._whole);
if (this.href) r.setAttribute("href", this.href);
this._eyebrowEl.textContent = this.eyebrow;
this._eyebrowEl.hidden = !this.eyebrow;
this._titleEl.textContent = this.cardTitle;
this._titleEl.hidden = !this.cardTitle;
this._bodyEl.textContent = this._text;
this._bodyEl.hidden = !this._text;
this._slot.textContent = "";
this._slot.hidden = !this.action;
if (this.action) {
const label = document.createElement(this._whole ? "span" : "button");
label.className = "kt-card-action";
if (!this._whole) {
label.type = "button";
label.addEventListener("click", (e) => this.fire(e.clientX, e.clientY, e.detail === 0));
}
const t = document.createElement("span");
t.textContent = this.action;
label.appendChild(t);
label.insertAdjacentHTML(
"beforeend",
'<svg viewBox="0 0 16 16" width="14" height="14" aria-hidden="true" focusable="false"><path d="M3 8h9M8.5 4l4 4-4 4" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"/></svg>'
);
if (this._whole) label.setAttribute("aria-hidden", "true");
this._slot.appendChild(label);
if (this._whole) {
// keep the label in the accessible name of the whole-card control
this._root.removeAttribute("aria-label");
}
}
}
reduced() {
return window.matchMedia && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
}
tilt(e) {
const mode = SakugaFX.getMode();
if (mode === "enterprise" || this.reduced() || e.pointerType === "touch") return;
const rect = this._root.getBoundingClientRect();
const px = (e.clientX - rect.left) / rect.width;
const py = (e.clientY - rect.top) / rect.height;
if (this._raf) return;
this._raf = requestAnimationFrame(() => {
this._raf = null;
const max = mode === "elastic" ? 7 : mode === "glitch" ? 3 : 5;
this._root.style.setProperty("--mx", `${px * 100}%`);
this._root.style.setProperty("--my", `${py * 100}%`);
this._root.style.setProperty("--rx", `${((0.5 - py) * 2 * max).toFixed(2)}deg`);
this._root.style.setProperty("--ry", `${((px - 0.5) * 2 * max).toFixed(2)}deg`);
});
}
untilt() {
if (this._raf) cancelAnimationFrame(this._raf);
this._raf = null;
["--rx", "--ry"].forEach((p) => this._root.style.removeProperty(p));
}
fire(cx, cy, fromKeyboard) {
const rect = this._root.getBoundingClientRect();
const x = fromKeyboard || !cx ? rect.left + rect.width / 2 : cx;
const y = fromKeyboard || !cy ? rect.top + rect.height / 2 : cy;
const mode = SakugaFX.getMode();
if (mode !== "enterprise") {
const color = readAccent(this._root);
if (mode === "glitch") SakugaFX.emitPixels(x, y, color, 10);
else if (mode === "ink") SakugaFX.emitInkSplatter(x, y, color, 8);
else if (mode === "neon") SakugaFX.emitShockwave(x, y, color, 56);
else SakugaFX.emitShockwave(x, y, color, 48);
}
this.dispatchEvent(
new CustomEvent("action", { bubbles: true, detail: { title: this.cardTitle, href: this.href, action: this.action } })
);
}
}
customElements.define("kt-kinetic-card", KtKineticCard);
function contrastInk(hex) {
const clean = hex.replace("#", "");
if (clean.length !== 6) return "#ffffff";
const r = parseInt(clean.slice(0, 2), 16);
const g = parseInt(clean.slice(2, 4), 16);
const b = parseInt(clean.slice(4, 6), 16);
const lum = (0.299 * r + 0.587 * g + 0.114 * b) / 255;
return lum > 0.6 ? "#09090b" : "#ffffff";
}
function readAccent(el) {
const val = getComputedStyle(el).getPropertyValue("--kt-accent").trim();
return val || "#09090b";
}
class SakugaVFXEngine {
constructor(canvas) {
this.canvas = canvas;
this.ctx = canvas.getContext("2d");
this.items = [];
this.rafId = null;
this.lastTime = 0;
this.textEnabled = false;
this.textOverride = "";
this.vfxTextColor = "auto";
this.resize();
window.addEventListener("resize", () => this.resize());
}
attach(canvas) {
this.canvas = canvas;
this.ctx = canvas.getContext("2d");
this.items = [];
this.resize();
}
resize() {
const dpr = Math.min(window.devicePixelRatio || 1, 2);
this.canvas.width = Math.floor(window.innerWidth * dpr);
this.canvas.height = Math.floor(window.innerHeight * dpr);
this.ctx.setTransform(dpr, 0, 0, dpr, 0, 0);
}
getMode() {
if (window.matchMedia("(prefers-reduced-motion: reduce)").matches) return "enterprise";
return document.documentElement.getAttribute("data-vfx") || "enterprise";
}
wake() {
if (this.rafId !== null) return;
this.lastTime = performance.now();
const tick = (now) => {
const dt = Math.min((now - this.lastTime) / 1000, 0.05);
this.lastTime = now;
this.render(dt);
if (this.items.length > 0) {
this.rafId = requestAnimationFrame(tick);
} else {
this.rafId = null;
this.ctx.clearRect(0, 0, window.innerWidth, window.innerHeight);
}
};
this.rafId = requestAnimationFrame(tick);
}
emitBurst(x, y, color, { count = 14, speed = 240, spread = Math.PI * 2, baseAngle = 0, shards = true } = {}) {
if (this.getMode() === "enterprise") return;
for (let i = 0; i < count; i++) {
const angle = baseAngle + (Math.random() - 0.5) * spread;
const vel = speed * (0.45 + Math.random() * 0.75);
this.items.push({
kind: shards && i % 3 === 0 ? "shard" : "spark",
x, y,
vx: Math.cos(angle) * vel,
vy: Math.sin(angle) * vel - (spread > 4 ? 35 : 0),
gravity: 400,
drag: 0.94,
size: 3 + Math.random() * 4,
rot: Math.random() * Math.PI * 2,
vrot: (Math.random() - 0.5) * 14,
life: 0,
maxLife: 0.32 + Math.random() * 0.22,
color
});
}
this.wake();
}
emitShockwave(x, y, color, maxRadius = 64) {
if (this.getMode() === "enterprise") return;
this.items.push({ kind: "ring", x, y, radius: 8, maxRadius, life: 0, maxLife: 0.32, color });
this.wake();
}
emitSlash(x, y, color, angle = -0.3) {
if (this.getMode() === "enterprise") return;
this.items.push({ kind: "slash", x, y, angle, length: 96, life: 0, maxLife: 0.2, color });
this.wake();
}
emitSmoke(x, y, color, dirX = 0) {
if (this.getMode() === "enterprise") return;
for (let i = 0; i < 4; i++) {
this.items.push({
kind: "smoke",
x: x + (Math.random() - 0.5) * 8,
y: y + (Math.random() - 0.5) * 8,
vx: dirX * (50 + Math.random() * 70) + (Math.random() - 0.5) * 35,
vy: -20 - Math.random() * 50,
size: 5 + Math.random() * 5,
life: 0,
maxLife: 0.34 + Math.random() * 0.16,
color
});
}
this.wake();
}
emitPixels(x, y, color, count = 14) {
if (this.getMode() !== "glitch") return;
for (let i = 0; i < count; i++) {
const angle = Math.floor(Math.random() * 8) * (Math.PI / 4);
const vel = 120 + Math.random() * 200;
this.items.push({
kind: "pixel",
x: x + (Math.random() - 0.5) * 18,
y: y + (Math.random() - 0.5) * 12,
vx: Math.cos(angle) * vel,
vy: Math.sin(angle) * vel,
size: 4 + Math.floor(Math.random() * 5),
life: 0,
maxLife: 0.24 + Math.random() * 0.14,
color
});
}
this.wake();
}
emitScanline(x, y, color, width = 120) {
if (this.getMode() !== "glitch") return;
for (let i = -1; i <= 1; i += 2) {
this.items.push({
kind: "scanline",
x,
y: y + i * (5 + Math.random() * 6),
width,
life: 0,
maxLife: 0.18,
color
});
}
this.wake();
}
emitRays(x, y, color, count = 10, maxRadius = 72) {
if (this.getMode() !== "neon") return;
for (let i = 0; i < count; i++) {
const angle = (Math.PI * 2 * i) / count + (Math.random() - 0.5) * 0.18;
this.items.push({
kind: "ray",
x,
y,
angle,
maxRadius: maxRadius * (0.75 + Math.random() * 0.45),
life: 0,
maxLife: 0.34,
color
});
}
this.wake();
}
emitInkSplatter(x, y, color, count = 14) {
if (this.getMode() !== "ink") return;
for (let i = 0; i < count; i++) {
const angle = Math.random() * Math.PI * 2;
const vel = 110 + Math.random() * 230;
this.items.push({
kind: "inkblot",
x,
y,
vx: Math.cos(angle) * vel,
vy: Math.sin(angle) * vel - 30,
gravity: 480,
drag: 0.91,
size: 2.5 + Math.random() * 5.5,
life: 0,
maxLife: 0.38 + Math.random() * 0.22,
color
});
}
// Brush arc sweep
this.items.push({
kind: "brusharc",
x,
y,
radius: 24 + Math.random() * 14,
startAngle: -Math.PI * 0.75,
endAngle: Math.PI * 0.35,
life: 0,
maxLife: 0.26,
color
});
this.wake();
}
emitMangaSFX(x, y, text, color) {
const mode = this.getMode();
const finalText = this.textOverride || text;
if (mode === "enterprise" || !this.textEnabled || !finalText || finalText === "none") return;
const fillColor = this.vfxTextColor !== "auto" ? this.vfxTextColor : color;
const outline = this.vfxTextColor !== "auto"
? contrastInk(this.vfxTextColor)
: (document.documentElement.getAttribute("data-bw") === "dark" ? "#09090b" : "#ffffff");
this.items.push({
kind: "sfx",
x: x + (Math.random() - 0.5) * 14,
y: y - 16,
vy: -48,
tilt: (Math.random() - 0.5) * 0.26,
text: finalText,
life: 0,
maxLife: 0.6,
color: fillColor,
outline
});
this.wake();
}
emitImpact(x, y, color, { sfx = "", scale = 1, dirX = 0, sfxY = y - 4 } = {}) {
const mode = this.getMode();
if (mode === "enterprise") return;
if (mode === "elastic") {
this.emitShockwave(x, y, color, Math.round(52 * scale));
this.emitSmoke(x, y, color, dirX);
} else if (mode === "glitch") {
this.emitPixels(x, y, color, Math.round(12 * scale));
this.emitScanline(x, y, color, Math.round(96 * scale));
} else if (mode === "neon") {
this.emitShockwave(x, y, color, Math.round(58 * scale));
this.emitRays(x, y, color, Math.round(9 * scale), Math.round(52 * scale));
} else if (mode === "ink") {
this.emitInkSplatter(x, y, color, Math.round(13 * scale));
} else {
this.emitShockwave(x, y, color, Math.round(50 * scale));
this.emitBurst(x, y, color, {
count: Math.round(12 * scale),
speed: Math.round(210 * scale),
spread: dirX ? 1.8 : Math.PI * 2,
baseAngle: dirX < 0 ? Math.PI : 0
});
this.emitSlash(x, y, color, -0.28);
}
this.emitMangaSFX(x, sfxY, sfx, color);
}
render(dt) {
const ctx = this.ctx;
ctx.clearRect(0, 0, window.innerWidth, window.innerHeight);
const next = [];
for (const p of this.items) {
p.life += dt;
if (p.life >= p.maxLife) continue;
const t = p.life / p.maxLife;
const easeOut = 1 - Math.pow(1 - t, 3);
const alpha = Math.max(0, 1 - Math.pow(t, 2));
ctx.save();
ctx.globalAlpha = alpha;
if (p.kind === "spark" || p.kind === "shard") {
p.vx *= Math.pow(p.drag, dt * 60);
p.vy = p.vy * Math.pow(p.drag, dt * 60) + p.gravity * dt;
p.x += p.vx * dt;
p.y += p.vy * dt;
p.rot += p.vrot * dt;
ctx.translate(p.x, p.y);
ctx.rotate(p.rot);
ctx.fillStyle = p.color;
if (p.kind === "shard") {
const s = p.size * (1 - t * 0.4);
ctx.beginPath();
ctx.moveTo(0, -s);
ctx.lineTo(s * 0.72, 0);
ctx.lineTo(0, s);
ctx.lineTo(-s * 0.72, 0);
ctx.closePath();
ctx.fill();
} else {
ctx.beginPath();
ctx.arc(0, 0, p.size * 0.5 * (1 - t * 0.5), 0, Math.PI * 2);
ctx.fill();
}
} else if (p.kind === "ring") {
const r = p.radius + (p.maxRadius - p.radius) * easeOut;
ctx.strokeStyle = p.color;
ctx.lineWidth = Math.max(1, 3 * (1 - t));
ctx.beginPath();
ctx.arc(p.x, p.y, r, 0, Math.PI * 2);
ctx.stroke();
} else if (p.kind === "slash") {
ctx.translate(p.x, p.y);
ctx.rotate(p.angle);
const len = p.length * easeOut;
const th = 4.5 * (1 - t);
ctx.fillStyle = p.color;
ctx.beginPath();
ctx.moveTo(-len, 0);
ctx.quadraticCurveTo(0, -th, len, 0);
ctx.quadraticCurveTo(0, th, -len, 0);
ctx.fill();
} else if (p.kind === "smoke") {
p.x += p.vx * dt;
p.y += p.vy * dt;
const r = p.size * (0.8 + easeOut * 1.25);
ctx.fillStyle = p.color;
ctx.globalAlpha = 0.24 * (1 - t);
ctx.beginPath();
ctx.arc(p.x, p.y, r, 0, Math.PI * 2);
ctx.fill();
} else if (p.kind === "pixel") {
p.x += p.vx * dt;
p.y += p.vy * dt;
ctx.fillStyle = p.color;
const s = p.size * (1 - t * 0.35);
ctx.fillRect(Math.round(p.x - s / 2), Math.round(p.y - s / 2), s, s);
} else if (p.kind === "scanline") {
const w = p.width * (0.4 + easeOut * 0.8);
ctx.fillStyle = p.color;
ctx.fillRect(p.x - w / 2, p.y, w, 2);
} else if (p.kind === "ray") {
const inner = 12 + easeOut * 16;
const outer = inner + p.maxRadius * (1 - t * 0.35);
ctx.strokeStyle = p.color;
ctx.shadowColor = p.color;
ctx.shadowBlur = 10;
ctx.lineWidth = Math.max(1, 2.8 * (1 - t));
ctx.beginPath();
ctx.moveTo(p.x + Math.cos(p.angle) * inner, p.y + Math.sin(p.angle) * inner);
ctx.lineTo(p.x + Math.cos(p.angle) * outer, p.y + Math.sin(p.angle) * outer);
ctx.stroke();
} else if (p.kind === "inkblot") {
p.vx *= Math.pow(p.drag, dt * 60);
p.vy = p.vy * Math.pow(p.drag, dt * 60) + p.gravity * dt;
p.x += p.vx * dt;
p.y += p.vy * dt;
ctx.fillStyle = p.color;
ctx.beginPath();
ctx.arc(p.x, p.y, p.size * (1 - t * 0.45), 0, Math.PI * 2);
ctx.fill();
} else if (p.kind === "brusharc") {
const sweep = p.startAngle + (p.endAngle - p.startAngle) * easeOut;
ctx.strokeStyle = p.color;
ctx.lineCap = "round";
ctx.lineWidth = Math.max(1.5, 6 * (1 - t));
ctx.beginPath();
ctx.arc(p.x, p.y, p.radius * (0.85 + easeOut * 0.4), p.startAngle, sweep);
ctx.stroke();
} else if (p.kind === "sfx") {
p.y += p.vy * dt * (1 - t * 0.6);
const s = t < 0.18 ? 0.55 + (t / 0.18) * 0.65 : 1.2 - (t - 0.18) * 0.25;
ctx.translate(p.x, p.y);
ctx.rotate(p.tilt);
ctx.scale(s, s);
ctx.font = '900 19px "Hiragino Kaku Gothic ProN", "Yu Gothic", system-ui, sans-serif';
ctx.textAlign = "center";
ctx.textBaseline = "middle";
ctx.lineJoin = "round";
ctx.lineWidth = 4.5;
ctx.strokeStyle = p.outline;
ctx.strokeText(p.text, 0, 0);
ctx.fillStyle = p.color;
ctx.fillText(p.text, 0, 0);
}
ctx.restore();
next.push(p);
}
this.items = next;
}
}
const SakugaFX = new SakugaVFXEngine(document.getElementById("sakuga-vfx-canvas"));
window.SakugaFX = SakugaFX;
window.readAccent = readAccent;
window.contrastInk = contrastInk;
Attributes
| Name | What it does | Default |
|---|---|---|
title | Card heading. | — |
eyebrow | Small uppercase line above the title. | — |
action | Action label. A button on a plain card, a styled label on a whole-card link. | — |
href | Make the whole card a link to this address. | — |
interactive | Make the whole card a button with lift, tilt and spotlight on hover. | — |
Keyboard and screen readers
- A plain card is an article. With href it is one link, with interactive it is one button: Tab focuses it, Enter (and Space for the button) activates it.
- Only one control per card, so there are no nested interactive elements; the action label is part of the whole-card control.
- Fires an "action" event when the action button or the whole card is activated.
- The tilt and spotlight follow the pointer only, and are off under reduced motion and in Enterprise mode.
Styling variables
Every look is a CSS variable: --kt-accent, --kt-accent-ink, --kt-radius-btn, --kt-surface-radius, --kt-surface-bg, --kt-border-w, --kt-comp-shadow and --font-sans. The
copied file sets them all from your choices.
FAQ
Kinetic Card: questions answered
How do I use the Kinetic Card?
Press Copy on the card to get a complete HTML file, or copy the HTML, CSS and JavaScript tabs into your own page. In your markup the element is written as <kt-kinetic-card>.
Which attributes does <kt-kinetic-card> accept?
title, eyebrow, action, href, interactive. Each one is described in the attributes table on this page.
Is the Kinetic Card accessible?
A plain card is an article. With href it is one link, with interactive it is one button: Tab focuses it, Enter (and Space for the button) activates it. Only one control per card, so there are no nested interactive elements; the action label is part of the whole-card control. Fires an "action" event when the action button or the whole card is activated. The tilt and spotlight follow the pointer only, and are off under reduced motion and in Enterprise mode.
Can I change the Kinetic Card colors, corners and font?
Yes. Use the options on this page: accent color, border radius, background, border, shadow and Google font. The copied code already contains your choices, and every one of them is a CSS variable you can edit later.