Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use captions? #529

Closed
jkinley opened this issue Sep 7, 2020 · 2 comments · Fixed by #530
Closed

How to use captions? #529

jkinley opened this issue Sep 7, 2020 · 2 comments · Fixed by #530
Labels

Comments

@jkinley
Copy link

jkinley commented Sep 7, 2020

Any chance you can provide a simple example of how to use captions? It would be nice if the demo had an example.

@browniebroke
Copy link
Owner

Good point. It's a bit tricky to get a real caption in the demo as I'm sourcing the images from the filesystem, so I just have to work with files, and I don't have meta data attached to them. But we could get something like the filename to show how to do it.

For a more real world example, I'm using this library on one of my website where the images are coming from DatoCMS. I'm able to grab the caption for each image directly in the GraphQL query as you can see here. The website is open source, and if you want to play with it, the data is publicly readable.

Basically, each object in the array passed as images prop has a caption field which is used in the lightbox component.

You can see it in action by clicking on the second image on this page, the caption is on the bottom left corner: https://www.carriere-alla.fr/photos/voutes/

image

@github-actions
Copy link
Contributor

🎉 This issue has been resolved in version 3.5.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants