-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
feat(core): add siderItemsAreCollapsed
prop to sider components
#6880
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- for use with sider nav items with children i.e multi-level
- mui - mantine - chakra-ui - antd
- add changeset
🦋 Changeset detectedLatest commit: d9724c0 The changes in this PR will be included in the next version bump. This PR includes changesets to release 5 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
✅ Deploy Preview for refine-doc-live-previews ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify project configuration. |
siderItems.isCollapsed
to refine options to set default expanded for nested sider items siderItems.isCollapsed
to refine options to set default expanded
siderItems.isCollapsed
to refine options to set default expandedsiderItems.isCollapsed
to refine options
siderItems.isCollapsed
to refine optionssiderItems.isCollapsed
to refine options
Hello @arndom, thanks for improving Refine 🚀 Sorry for the late reply. Instead of passing this directly to What do you think? import { ThemedLayoutV2, ThemedSiderV2 } from "@refinedev/antd";
<ThemedLayoutV2
Sider={() => (
<ThemedSiderV2
siderItemsAreCollapsed={true}
/>
)}
/> |
No worries, @alicanerdurmaz. Yh, I agree. I did it that way because of the issue's description, but in hindsight, it does make the code clearer if the options to control the sider are its props. I'll implement it later today. |
- update all previous implementations and docs
- comment cleanup
siderItems.isCollapsed
to refine optionssiderItemsAreCollapsed
prop to sider components
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds a new siderItemsAreCollapsed
prop to sider components across all UI packages (Ant Design, Material-UI, Mantine, Chakra-UI) to control whether nested sidebar items are expanded or collapsed by default.
Key changes:
- Added the
siderItemsAreCollapsed
boolean prop with a default value oftrue
to maintain backward compatibility - Implemented logic in each UI package to respect this prop when determining default expansion state
- Updated documentation across all UI integration guides to document the new prop
Reviewed Changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
packages/ui-types/src/types/layout.tsx | Added type definition for the new prop |
packages/mui/src/components/themedLayoutV2/sider/index.tsx | Implemented prop logic for Material-UI sider |
packages/mantine/src/components/themedLayoutV2/sider/index.tsx | Implemented prop logic for Mantine sider |
packages/chakra-ui/src/components/themedLayoutV2/sider/index.tsx | Implemented prop logic for Chakra-UI sider |
packages/antd/src/components/themedLayoutV2/sider/index.tsx | Implemented prop logic for Ant Design sider |
documentation/docs/ui-integrations/*/components/themed-layout/index.md | Updated documentation tables to include the new prop |
.changeset/purple-bobcats-reflect.md | Added changeset for the feature |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello, @arndom thanks for your contribution, great work! 🚀
PR Checklist
Please check if your PR fulfills the following requirements:
Bugs / Features
What is the current behavior?
Nested sider items are collapsed by default.
What is the new behavior?
Nested sider items can now have expanded/collapsed as the default.
Resolves #6721
Notes for reviewers