Using Events through Overrides
Events can be used to make anything in Framer interactive. Events are things that happen, such as basic interactions like click, tap, and swipe, as well as things like “video ended” or “device rotated”.
They consist of a type and a handler with code that needs to be run when the event happens. Event types in Framer follow the same style as JavaScript and React — onClick, onTap, onScroll, etc.
Below is a simple example of an event handler that logs a message to the console with console.log
every time you click the Frame that the override applies to.
import { Override } from "framer";export function LogTap(): Override { return { onTap() { console.log("Hello") }, }}