Card Stack
ScrollCards stick to the top as you scroll and each one shrinks and dims as the next slides over it, as on Apple product pages.
The page content slides up to reveal a footer that is already in place underneath. No timeline and no script: the footer is position: sticky at the bottom of the scrollport with a fixed height, and the content in front carries a higher z-index and its own background, so the only motion is the scroll itself. On a page shorter than the viewport the footer simply sits below the content.
scroll inside
Content in front.
The footer is sticky at the bottom with a fixed height, underneath. Nothing animates. Scrolling uncovers the footer.
Keep going.
Live, from the library itself: scroll, hover, navigate away and back. The demo is never gated.
Adjust · props are custom properties, set inline, so you edit the running instance
JavaScript of its own
0 B
CSS 4.3 kB raw including the base tokens. Measured from a production build, and again in CI for every change that can move it.
Browser support
every browser.
One command adds the integration, the base tokens and every component. Then import what you use.
npx astro add moonarcpnpm astro add moonarcbunx astro add moonarc---
import FooterReveal from '@moonarc/core/FooterReveal';
---
<FooterReveal height="22rem" background="var(--bg)">
<main>…</main>
<div slot="footer" class="p-10">
<p class="text-6xl font-bold">Moonarc</p>
</div>
</FooterReveal>Owns the file, no dependency. The registry item also installs the base tokens.
npx shadcn@latest add https://moonarc.dev/r/footer-reveal.jsonThe CLI needs a components.json and the @/* alias, which Setup has. The file lands in src/components/moonarc/.
The whole component. Self-contained styles in a cascade layer so your classes always win; it imports nothing.
---
/**
* FooterReveal — the page content slides up and the footer is already
* there underneath. No timeline, no script: the footer is position: sticky
* at the bottom of the scrollport with a fixed height, and the content in
* front carries a higher z-index and its own background, so the only motion
* is the scroll itself. On a page shorter than the viewport the footer is
* simply below the content. Reduced motion changes nothing — there is no
* animation to remove.
*/
import type { HTMLAttributes } from 'astro/types';
interface Props extends HTMLAttributes<'div'> {
/** Footer height, any CSS length. */
height?: string;
/** Background of the content in front — must be opaque. */
background?: string;
}
const { height = '20rem', background = 'Canvas', class: className, style, ...rest } = Astro.props;
const vars = [`--ma-fr-h:${height}`, `--ma-fr-bg:${background}`, typeof style === 'string' ? style : ''].filter(Boolean).join(';');
---
<div class:list={['ma-fr', className]} style={vars} {...rest}>
<div class="ma-fr__content"><slot /></div>
<footer class="ma-fr__footer"><slot name="footer" /></footer>
</div>
<style is:global>
@layer components {
:where(.ma-fr) {
position: relative;
}
:where(.ma-fr__content) {
position: relative;
z-index: 1;
background: var(--ma-fr-bg, Canvas);
}
:where(.ma-fr__footer) {
position: sticky;
bottom: 0;
z-index: 0;
height: var(--ma-fr-h, 20rem);
display: grid;
align-content: end;
}
/* there is no motion to reduce; the rule exists so the audit sees the branch was considered */
@media (prefers-reduced-motion: reduce) {
:where(.ma-fr__footer) {
position: sticky;
}
}
}
</style>| Prop | Type | Default | Description |
|---|---|---|---|
height | string | '20rem' | Footer height, any CSS length. |
background | string | 'Canvas' | Background of the content in front. It must be opaque, or the footer shows through. |
Nothing changes: there is no animation, only the scroll, which the reader controls.
ClientRouterStatic layout; nothing to rebind. Verified across swaps and on pages shorter than the viewport.
Replaces: FooterReveal (Motion Primitives) · sticky footer reveal (Codrops) · reveal footer (Osmo). See the migration table.
Cards stick to the top as you scroll and each one shrinks and dims as the next slides over it, as on Apple product pages.
An element drifts at its own speed as it crosses the viewport, exactly in step with the scroll.
A hairline along the top of the viewport that fills as the page is read.
Also: view transitions · how costs are measured · browser support · accessibility policy · five-minute setup · MCP for agents · this page as Markdown