themesberg / themesberg/flowbite-react
Carousel should allow enable/disable controls
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 2.1k
- Forks
- 506
- PR merge metrics
- No merged PRs in 30d
Description
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.
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?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the Carousel component, using the existing leftControl and rightControl props as the entry point. Trace how the controls and their hover cursor are rendered, then define the new enable/disable behavior for a single-image carousel. Done means disabled controls and their hover cursor are absent while the carousel remains usable.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react, tailwindcss, typescript
- Domain
- frontend
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100