Skip to content

Add div inside Lightbox #87

Answered by igordanchenko
eStasicki asked this question in Q&A
Discussion options

You must be logged in to vote

If you'd like to render a custom lightbox element that doesn't move with each slide, you can use the render.controls render function (this render function was added in v3).

<Lightbox
  render={{
    controls: () => (
      <div style={{ position: "absolute", color: "white", top: 16, left: 16 }}>
        Custom lightbox element
      </div>
    )
  }}
  // ...
/>

But if you'd like your custom element to appear on each slide (and move with each slide), you can use the render.slideFooter render function.

<Lightbox
  render={{
    controls: () => (
      <div style={{ position: "absolute", color: "white", bottom: 16, left: 16 }}>
        Custom slide element
      </div>
    )
  }}
  // ...
/>

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by igordanchenko
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants