Interactive Background Boxes Ripple Effect
Hover over the boxes above and click.To be used on backgrounds of hero sections OR Call to Action sections. I beg you don't use it everywhere.
Installation
Run the following command
npx shadcn@latest add https://ui.aceternity.com/registry/background-ripple-effect.json
Add this in your globals.css
file
@theme inline {
--animate-cell-ripple: cell-ripple var(--duration, 200ms) ease-out none 1
var(--delay, 0ms);
@keyframes cell-ripple {
0% {
opacity: 0.4;
}
50% {
opacity: 0.8;
}
100% {
opacity: 0.4;
}
}
}
Props
Background Ripple Effect Props
Prop | Type | Default | Description | Required |
---|---|---|---|---|
rows | number | 8 | Number of rows in the grid. | No |
cols | number | 27 | Number of columns in the grid. | No |
cellSize | number | 56 | Size of each square cell in pixels. | No |
DivGrid Props
Prop | Type | Default | Description | Required |
---|---|---|---|---|
rows | number | - | Number of rows in the grid. | Yes |
cols | number | - | Number of columns in the grid. | Yes |
cellSize | number | - | Size of each cell in pixels. | Yes |
borderColor | string | - | CSS color value for cell borders. | Yes |
fillColor | string | - | CSS color value for cell fill. | Yes |
clickedCell | { row: number; col: number } | null | null | The currently clicked cell coordinates. | No |
onCellClick | (row: number, col: number) => void | undefined | Callback function called when a cell is clicked. | No |
interactive | boolean | false | Whether cells respond to mouse interactions. | No |
className | string | undefined | Additional CSS classes to apply to the grid container. | No |
Build websites faster and 10x better than your competitors with Aceternity UI Pro
With the best in class components and templates, stand out from the crowd and get more attention to your website. Trusted by founders and entrepreneurs from all over the world.
Manu is the man! He is the best front-end developer I have worked with.
He took the requirements and quite literally ran with them. We are super happy with the result and product we go...
John Shahawy
Founder at Rogue and Moonbeam