Page Curl
书页卷边
A lifted page corner curls back and casts a soft shadow as the next page appears.
Where to use it
Move between pages in a story, editorial, or image sequence. Give the turning corner a comfortably sized hit area and keep the page action available from the keyboard.
Practical example
A digital travel journal lifts the corner of each spread on hover. Activating that corner opens the next spread.
Also called
- Page Turn
- Page Flip
AI prompt
Add Page Curl to [card or article]. Lift the top-right corner on hover, and let viewers turn to the next page by clicking or pressing Enter. Give the curl a soft shadow. For reduced motion, switch pages instantly.
Example code
Save the standalone HTML as a file and open it in your browser. It uses the same code as the preview.
View HTML
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Page Curl</title>
<style>
:root {
color-scheme: dark;
--demo-bg: #171629;
--demo-ink: #f8f5ff;
--demo-accent: #b9a6ff;
--demo-muted: #bfbbd3;
font-family: system-ui, sans-serif;
color: var(--demo-ink);
background: var(--demo-bg);
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-width: 0; }
button, input { font: inherit; }
.demo {
display: grid;
place-items: center;
align-content: center;
min-height: 100vh;
padding: 14px;
overflow: hidden;
background: radial-gradient(ellipse at 50% 24%, #28233f, var(--demo-bg) 78%);
}
.demo-button {
border: 1px solid #ffffff3d;
border-radius: 7px;
background: #ffffff12;
color: var(--demo-ink);
padding: 6px 11px;
font-size: 12px;
cursor: pointer;
}
:focus-visible {
outline: 2px solid var(--demo-accent);
outline-offset: 3px;
}
.demo { background: radial-gradient(ellipse at 42% 18%, #284e48, #102928 74%); }
.book {
--curl-x: 34px;
--curl-y: 29px;
position: relative;
display: block;
width: min(100%, 236px);
height: 126px;
padding: 0;
border: 0;
border-radius: 3px;
background: #c18a59;
color: #1d3230;
box-shadow: 0 2px 0 #dec5a1, 0 4px 0 #bba488, 0 18px 30px #071c1bc2;
cursor: pointer;
perspective: 430px;
transition: background .35s ease;
}
.paper {
position: absolute;
inset: 0;
display: flex;
flex-direction: column;
justify-content: center;
align-items: flex-start;
gap: 5px;
padding: 15px 25px;
border-radius: inherit;
text-align: left;
}
.paper > span { font: 10px/1.2 system-ui, sans-serif; }
.paper strong { font: 400 32px/.95 Georgia, serif; letter-spacing: -.055em; }
.paper i { width: min(75%, 80px); margin-top: 6px; border-top: 1px solid currentColor; opacity: .4; }
.paper-next {
color: #482619;
background: repeating-linear-gradient(0deg, #ffffff09 0 1px, transparent 1px 3px), linear-gradient(130deg, #efcfa5, #c18a59);
box-shadow: inset 5px 0 6px #693b3b30;
}
.paper-next > span { align-self: flex-end; }
.paper-current {
color: #23403a;
background: repeating-linear-gradient(0deg, #88705208 0 1px, transparent 1px 3px), linear-gradient(115deg, #d9c8aa, #fff0cf 22%, #f7e6c7);
clip-path: polygon(0 0, calc(100% - var(--curl-x)) 0, 100% var(--curl-y), 100% 100%, 0 100%);
transform-origin: left;
transition: clip-path .35s ease, transform .46s ease, opacity .34s ease;
}
.paper-fold {
position: absolute;
top: 0;
right: 0;
width: var(--curl-x);
height: var(--curl-y);
filter: drop-shadow(-2px 4px 3px #69482580);
transition: width .35s ease, height .35s ease, opacity .2s ease;
}
.paper-fold::before {
content: '';
position: absolute;
inset: 0;
border-radius: 0 0 0 23%;
background: linear-gradient(40deg, #c29c75, #e5cfa7 26%, #fff0d0 42%, #a5805a 67%);
clip-path: polygon(0 0, 100% 100%, 0 100%);
}
.book:is(:hover, :focus-visible) { --curl-x: 95px; --curl-y: 75px; }
.book[aria-pressed='true'] .paper-current { transform: rotateY(-82deg); opacity: 0; }
.book[aria-pressed='true'] .paper-fold { opacity: 0; }
@media (prefers-reduced-motion: reduce) {
.book:is(:hover, :focus-visible) { --curl-x: 34px; --curl-y: 29px; }
.paper-current, .paper-fold { transition: none; }
.book[aria-pressed='true'] .paper-current { transform: none; }
}
[role="status"] { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
</style>
</head>
<body>
<main class="demo">
<button class="book" type="button" aria-pressed="false" aria-label="Turn the page">
<span class="paper paper-next" aria-hidden="true">
<span>Page 2</span>
<strong>The coast</strong>
<i></i>
</span>
<span class="paper paper-current" aria-hidden="true">
<span>Page 1</span>
<strong>Tidal Notes</strong>
<i></i>
</span>
<span class="paper-fold" aria-hidden="true"></span>
</button>
<span role="status" data-on="Page 2, The coast" data-off="Page 1, Tidal Notes"></span>
</main>
<script>
const button = document.querySelector('[aria-pressed]');
button.addEventListener('click', () => {
button.setAttribute('aria-pressed', String(button.getAttribute('aria-pressed') !== 'true'));
});
const status = document.querySelector('[role="status"]');
button.addEventListener('click', () => {
status.textContent = button.getAttribute('aria-pressed') === 'true' ? status.dataset.on : status.dataset.off;
});
</script>
</body>
</html>Original example by UI Skills