Skip to content

How to add a poll below the thumbnails? #225

Discussion options

You must be logged in to vote

Hi there!

You are absolutely correct; you need a custom plugin in this case. To add your poll component below the thumbnails, you need to wrap the topmost Thumbnails element with an extra <div> and render your poll below.

Here is how you can implement this.

// Poll.tsx

import {
  ComponentProps,
  createModule,
  PLUGIN_THUMBNAILS,
  PluginProps,
  useLightboxState,
} from "yet-another-react-lightbox";

function PollComponent({ children }: ComponentProps) {
  // access current slide if needed
  const { currentSlide } = useLightboxState();

  return (
    <div
      style={{
        height: "100%",
        display: "flex",
        flexDirection: "column",
      }}
    >
      {children}

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@MennatAllahMagdy
Comment options

@igordanchenko
Comment options

@MennatAllahMagdy
Comment options

Answer selected by MennatAllahMagdy
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