Fade In On Scroll
Content that fades and rises into place as it enters the viewport.
6 個のフレームワーク中級
Grid items that fade and slide up in sequence as the grid enters the viewport.
<!--
A CSS grid whose items start hidden; one observer reveals them with a
per-item transition delay. Reduced motion / no-JS shows them immediately.
-->
<ul
class="grid gap-3 [grid-template-columns:repeat(auto-fill,minmax(min(100%,180px),1fr))]"
data-stagger
>
<li class="translate-y-4 rounded-xl border border-gray-200 bg-white p-4 text-sm text-gray-700 opacity-0 shadow-sm transition duration-500 ease-[cubic-bezier(0.16,1,0.3,1)] data-[shown=true]:translate-y-0 data-[shown=true]:opacity-100 motion-reduce:translate-y-0 motion-reduce:opacity-100 motion-reduce:transition-none dark:border-gray-800 dark:bg-gray-900 dark:text-gray-300">Realtime sync</li>
<li class="translate-y-4 rounded-xl border border-gray-200 bg-white p-4 text-sm text-gray-700 opacity-0 shadow-sm transition duration-500 ease-[cubic-bezier(0.16,1,0.3,1)] data-[shown=true]:translate-y-0 data-[shown=true]:opacity-100 motion-reduce:translate-y-0 motion-reduce:opacity-100 motion-reduce:transition-none dark:border-gray-800 dark:bg-gray-900 dark:text-gray-300">Edge caching</li>
<li class="translate-y-4 rounded-xl border border-gray-200 bg-white p-4 text-sm text-gray-700 opacity-0 shadow-sm transition duration-500 ease-[cubic-bezier(0.16,1,0.3,1)] data-[shown=true]:translate-y-0 data-[shown=true]:opacity-100 motion-reduce:translate-y-0 motion-reduce:opacity-100 motion-reduce:transition-none dark:border-gray-800 dark:bg-gray-900 dark:text-gray-300">Audit logs</li>
<li class="translate-y-4 rounded-xl border border-gray-200 bg-white p-4 text-sm text-gray-700 opacity-0 shadow-sm transition duration-500 ease-[cubic-bezier(0.16,1,0.3,1)] data-[shown=true]:translate-y-0 data-[shown=true]:opacity-100 motion-reduce:translate-y-0 motion-reduce:opacity-100 motion-reduce:transition-none dark:border-gray-800 dark:bg-gray-900 dark:text-gray-300">SSO & SCIM</li>
</ul>
<noscript>
<style>[data-stagger] > * { opacity: 1 !important; transform: none !important; }</style>
</noscript>
<script>
(function () {
var grid = document.querySelector('[data-stagger]');
if (!grid) return;
var items = grid.children;
function showAll() {
for (var i = 0; i < items.length; i++) items[i].dataset.shown = 'true';
}
if (
!('IntersectionObserver' in window) ||
window.matchMedia('(prefers-reduced-motion: reduce)').matches
) {
showAll();
return;
}
var observer = new IntersectionObserver(
function (entries) {
entries.forEach(function (entry) {
if (!entry.isIntersecting) return;
for (var i = 0; i < items.length; i++) {
items[i].style.transitionDelay = i * 90 + 'ms';
}
showAll();
observer.disconnect();
});
},
{ threshold: 0.15 }
);
observer.observe(grid);
})();
</script>| Prop | 型 | デフォルト | 説明 |
|---|---|---|---|
items必須 | ReactNode[] | - | レンダリングする項目の配列。 |
minItemWidth | number | 180 | Min item width |
staggerMs | number | 90 | Stagger ms |
distance | number | 16 | 要素が移動する距離(ピクセル)。 |
once | boolean | true | 初めてビューに入ったときだけアニメーションします。 |
Tune `staggerMs` for a tighter or looser cascade and `distance` for the slide length. Set `once={false}` to replay the reveal whenever the grid re-enters view.