# API and events

> `lightbox()` returns an object to open, move and close the box from your own code, and to listen for its events.

This gallery also has `loop: true`, so after the last photo comes the first.

{{< example name="demo" title="API and events" >}}

{{< example name="dialog" frame="false" >}}
