Skip to content

How to customize slide title #110

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

You must be logged in to vote

Hi, you do not need to use the render.slideHeader render function in this case since it's not related to the Captions plugin at all.

To customize the slide title, simply assign your jsx markup to the slide's title attribute as follows:

<Lightbox
  slides={[
    {
      src: "https://picsum.photos/id/237/1800/1200",
      title: (
        <a
          href="https://picsum.photos"
          target="_blank"
          rel="noopener noreferrer"
        >
          Puppy
        </a>
      )
    }
  ]}
  open={open}
  close={() => setOpen(false)}
  plugins={[Captions]}
/>

https://codesandbox.io/s/yet-another-react-lightbox-110-xdr1d8?file=/src/App.js

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
3 replies
@hugo-ym
Comment options

@igordanchenko
Comment options

@hugo-ym
Comment options

Answer selected by igordanchenko
Comment options

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