Skip to main content

Interaction properties

Interaction properties allow you to add event handlers to components. At the moment only onClick is supported.

onClick​

Adds onClick handler to any selected element and exposes it via props.

onClick prop example

After publishing, you can access this prop on your component like so:

App.js
import Listing from "@martynas/listing";

const App = () => {
return <Listing onClick={(event) => alert("I was clicked!")} />;
};

export default App;