Download the PHP package laraextend/scroll-reveal without Composer
On this page you can find all versions of the php package laraextend/scroll-reveal. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download laraextend/scroll-reveal
More information about laraextend/scroll-reveal
Files in laraextend/scroll-reveal
Package scroll-reveal
Short Description Flexible, Livewire-compatible scroll-reveal animation component for Laravel Blade — powered by josh.js.
License MIT
Homepage https://github.com/laraextend/scroll-reveal
Informations about the package scroll-reveal
Laravel Scroll Reveal
Scroll-triggered animations for Laravel Blade — powered by Animate.css.
laraextend/scroll-reveal provides a flexible <x-scroll-reveal> Blade component that wraps any content in a scroll-triggered animation. It ships with its own zero-dependency JavaScript driver (built on the native Intersection Observer API) and works seamlessly in plain Blade templates and Livewire.
No external JavaScript runtime required. The package includes its own driver script (
scroll-reveal-driver.js) — no third-party npm package needed.
✨ Features
- 🧩 One Blade Component —
<x-scroll-reveal>wraps any HTML content with scroll-triggered animations - 🎬 Built-in JS Driver —
<x-scroll-reveal-scripts>injects a zero-dependency Intersection Observer driver — no npm package required - 🎨 30+ Animation Aliases — Intuitive names (
fade-up,zoom-in,slide-left, …) mapped to Animate.css classes - ⚡ Livewire Ready — All
wire:*,x-*anddata-*attributes are forwarded automatically; re-initialized afterlivewire:navigated - 🏷️ Dynamic HTML Tag — Render as any element (
div,section,article,span, …) via theasprop - ⏱️ Timing Control — Fine-grained
durationanddelayprops per element - 🔇 Opt-Out Anywhere — Pass
:animate="false"to disable animation for a specific element at runtime - ⚙️ Configurable Defaults — Publish the config file to set project-wide defaults
- 📦 Zero Config — Works immediately after installation with sensible defaults
📋 Requirements
- PHP >= 8.2
- Laravel >= 10.x
- Animate.css >= 4.x — for the CSS keyframe animations (loaded via CDN or npm)
🚀 Installation
1. Install the package via Composer
The ServiceProvider is registered automatically via Laravel's Auto-Discovery.
2. JavaScript Setup
This package generates the HTML data-* attributes for the animation driver. You have three options for the frontend setup — choose whichever fits your project.
Option A — Vite / app.js (recommended)
The driver is bundled via Vite — no <x-scroll-reveal-scripts> in the layout required.
Step 1 — Publish the driver to resources/js/:
This copies scroll-reveal-driver.js to resources/js/scroll-reveal-driver.js so Vite can bundle it.
Step 2 — Install Animate.css:
Step 3 — Add to resources/js/app.js:
Step 4 — Import the CSS in your stylesheet (e.g. resources/css/app.css):
CSS imports belong in CSS files —
@import 'animate.css'in your stylesheet is sufficient. No need to also import it inapp.js.
Step 5 — Restart the dev server:
Option B — Built-in driver without Vite
The package ships its own Intersection Observer driver. Publish it to your public/ directory once:
This copies scroll-reveal-driver.js to public/vendor/scroll-reveal/scroll-reveal-driver.js.
Then add <x-scroll-reveal-scripts> and the Animate.css link to your layout (e.g. resources/views/layouts/app.blade.php):
Inside <head>:
Before the closing </body> tag:
That is all. No npm install. No JS configuration. The component handles initialization and Livewire SPA navigation automatically.
Available props for <x-scroll-reveal-scripts>:
| Prop | Type | Default | Description |
|---|---|---|---|
initClass |
string |
'animateme' |
CSS class the driver watches. Must match what the component sets. |
offset |
float |
0.2 |
Fraction of the element that must be visible to trigger (0–1). |
animateOut |
bool |
false |
Re-animate when an element leaves and re-enters the viewport. |
inline |
bool |
false |
Embed the driver script inline instead of referencing the file (useful if you skip the publish step). |
Inline mode (no publish step needed at all):
Option C — CDN only (no build step, no npm)
Inside <head>:
Before the closing </body> tag:
3. Done!
No config files, no migrations, no additional steps required.
4. Optional Configuration
Publish the config file to set project-wide defaults:
Published file: config/scroll-reveal.php
🎬 Usage
Basic usage
Custom animation & timing
Full example with Tailwind classes
Different HTML tags
Disable animation at runtime
Inside a Livewire component
All standard Blade and Livewire attributes pass through without extra configuration:
📐 <x-scroll-reveal> Props Reference
| Prop | Type | Default | Description |
|---|---|---|---|
animate |
bool |
true |
Enable or disable the animation entirely. |
animation |
string |
'fade-up' |
Animation alias (see Animation Aliases). |
duration |
int |
700 |
Animation duration in milliseconds. |
delay |
int |
0 |
Animation delay in milliseconds (0 = no delay). |
as |
string |
'div' |
HTML tag to render (div, section, article, span, …). |
All additional attributes (e.g. class, id, wire:*, x-*, data-*) are forwarded directly to the rendered element.
🎨 Animation Aliases
All aliases are mapped to their corresponding Animate.css class names.
Fade
| Alias | Animate.css class |
|---|---|
fade |
fadeIn |
fade-up |
fadeInUp |
fade-down |
fadeInDown |
fade-left |
fadeInRight |
fade-right |
fadeInLeft |
Zoom
| Alias | Animate.css class |
|---|---|
zoom-in |
zoomIn |
zoom-out |
zoomOut |
zoom-up |
zoomInUp |
zoom-down |
zoomInDown |
zoom-left |
zoomInRight |
zoom-right |
zoomInLeft |
Slide
| Alias | Animate.css class |
|---|---|
slide-up |
slideInUp |
slide-down |
slideInDown |
slide-left |
slideInRight |
slide-right |
slideInLeft |
Flip
| Alias | Animate.css class |
|---|---|
flip-up |
flipInX |
flip-down |
flipInX |
flip-left |
flipInY |
flip-right |
flipInY |
Rotate
| Alias | Animate.css class |
|---|---|
rotate-in |
rotateIn |
rotate-left |
rotateInUpLeft |
rotate-right |
rotateInUpRight |
Creative / Special
| Alias | Animate.css class |
|---|---|
swing-in |
jackInTheBox |
drop |
bounceInDown |
rise |
bounceInUp |
skew-left |
lightSpeedInRight |
skew-right |
lightSpeedInLeft |
blur-in |
zoomIn |
Unknown aliases fall back to
fadeInUp.
⚙️ Configuration
After publishing the config file, you can set project-wide defaults in config/scroll-reveal.php:
Note: The component props override the config defaults. The
driver_optionskey is informational only — it is not automatically injected into JavaScript.
🔍 How It Works
- The
<x-scroll-reveal>Blade component renders a standard HTML element. -
When
animateistrue, it adds the CSS classanimatemeand threedata-*attributes: - The JavaScript driver observes all
.animatemeelements via the Intersection Observer API. - When an element enters the viewport, the driver reads the
data-sr-*attributes and applies the correspondinganimate__CSS class from Animate.css. - When
animateisfalse, no attributes are added — a plain element is rendered.
🧪 Testing
📄 License
MIT — see LICENSE.
All versions of scroll-reveal with dependencies
illuminate/support Version ^10.0|^11.0|^12.0|^13.0
illuminate/view Version ^10.0|^11.0|^12.0|^13.0