diff --git a/docs/advanced.md b/docs/advanced.md index 0ff87d9..7c7ba66 100644 --- a/docs/advanced.md +++ b/docs/advanced.md @@ -140,14 +140,30 @@ augmentations are applied before the lightbox starts rendering. For example, you can add a toolbar button using the following augmentation: -```jsx -import { addToolbarButton } from "yet-another-react-lightbox"; +```tsx +import { addToolbarButton, IconButton } from "yet-another-react-lightbox"; + +declare module "yet-another-react-lightbox" { + interface Labels { + "My button"?: string; + } +} // ... function MyPlugin({ augment }) { augment(({ toolbar, ...restProps }) => ({ - toolbar: addToolbarButton(toolbar, "my-button", ), + toolbar: addToolbarButton( + toolbar, + "my-button", + { + // ... + }} + />, + ), ...restProps, })); }