themesberg / themesberg/flowbite-react
Dynamically collapse Sidebar
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 2.1k
- Forks
- 506
- PR merge metrics
- No merged PRs in 30d
Description
- I have searched the Issues to see if this bug has already been reported
- I have tested the latest version
Summary
The Sidebar component should have the ability to be collapsed and opened by the user clicking a button on it. Currently there's no way to accomplish this because the icon prop on Sidebar.Item expects a component, not an instance of a component, so there's no way to attach an onClick handler to it to then set the collapse property on the Sidebar.
Context
I need a sidebar or drawer on the right side of my page that the user can collapse and open as they want to so that it isn't always taking up space. For now I might have to just leave it open all the time because I have no good place to put a button that collapses and shows the sidebar.
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 with the Sidebar and Sidebar.Item components, focusing on the icon prop and the Sidebar collapse property described in the issue. Determine how a user-facing button can toggle the sidebar, then verify that the sidebar can be opened and collapsed by clicking it, including for a right-side layout.
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
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100