react-slick icon indicating copy to clipboard operation
react-slick copied to clipboard

Customize arrows and dots inside a div so that we can position the main div of arrows and dots anywhere for Next.js 14.

Open Irshadraza opened this issue 1 year ago • 3 comments

I want to customise the arrows and dots inside a div as below code

  for the design 

Pagination

Kindly help me to slick slider code for the same.

Irshadraza avatar Feb 21 '24 09:02 Irshadraza

u can create custom dots and arrows + use ref<Slider> for catch control

advanceddev avatar Mar 19 '24 19:03 advanceddev

also interested in this topic

@advanceddev how do you create custom dots?

for the arrows you can apparently use ref and then call slickPrev() and slickNext()

xiemic avatar Mar 22 '24 16:03 xiemic

Kind of in the same boat. Wanted to have custom dots hovering over the image - managed to do that but now I can't find a way to apply custom styles to the active dot. The appendDots property callback just gives you pregenerated li elements (which I wouldn't even want to use) and I can't detect which one is active and which one isn't.

image

EDIT: As it always goes, as soon as you post a question you find a solution to it yourself. Turns out the first appendDots function parameter is actually an array of ReactNode and not one node so the solution I came up with is converting it to a list of children and check for the active class name. Mind you, the dotsClass is mandatory if you want to style the outer container (any classes you add to the element wrapping the dots, in my case a div will be wiped.

image

codeaid avatar Jul 11 '24 18:07 codeaid