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

Adding Custom Description #131

Open
LDevISBX opened this issue Sep 30, 2022 · 3 comments
Open

Adding Custom Description #131

LDevISBX opened this issue Sep 30, 2022 · 3 comments

Comments

@LDevISBX
Copy link

Hi I am having trouble adding custom description with the react-photo-view
I can't see a sample having the same result
image

@MinJieLiu
Copy link
Owner

Can you describe it in detail

@surushTodzhibekov
Copy link

why there is no example explaining how to add custom description. I want to implement custom description but cannot find any example.

@liliakai
Copy link

Use the overlayRender attribute in PhotoProvider, but also you need to style the output as an overlay. Here is an example using tailwind.css classes:

<PhotoProvider
   overlayRender={ ({ images, index }) => {
     const className = `
       absolute left-0 bottom-0 p-2 w-full min-h-24
       text-xs text-slate-300 z-50 bg-black/50
     `;
     return (
       <div className={className}>
         { "custom description" }
       </div>
     );
   }}
>
...

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

No branches or pull requests

4 participants