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

Carousel should allow enable/disable controls

Open pippinmole opened this issue 2 years ago • 3 comments

Is your feature request related to a problem? Please describe. Add a prop that enables and disables entirely the < > controls either side of a carousel. I have a solution but it means that the cursor type when hovering over the 'would be control' changes.

https://user-images.githubusercontent.com/40035529/233662484-63def9a4-1502-40e8-8a3f-0c6001c4c208.mov

Describe the solution you'd like In my instance, I would like to turn off controls (The buttons either side of a carousel to allow a user to switch between images), if there's only 1 photo in the carousel.

Describe alternatives you've considered Currently I'm using this sort of logic:

  const controlValue = post?.images.length > 1
    ? ""
    : " "
  
  return (
    <Carousel leftControl={controlValue} rightControl={controlValue}>
      {...}
    </Carousel>
  )

which works but could be cleaner?

pippinmole avatar Apr 21 '23 14:04 pippinmole

@rluders @tulup-conner I would like to work on this feature and add a prop to carousel that completely disables left and right arrows it can be useful for mobile when you want the carousel to only be draggable if it's okey please let me to know,I will work on it.

paghar avatar Jun 11 '23 08:06 paghar

Done! @paghar

tulup-conner avatar Jun 12 '23 00:06 tulup-conner

is there no option to customize only the two next and previous rounded buttons ?

ghost avatar Jul 07 '23 15:07 ghost