Skip to content
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

feat(sidebar): add SidebarGroupActions component for multiple actions #5505

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

AiraNadih
Copy link

@AiraNadih AiraNadih commented Oct 22, 2024

Add SidebarGroupActions Component and Optimize SidebarGroupAction

Overview

This PR introduces a new SidebarGroupActions component and optimizes the existing SidebarGroupAction component. These changes aim to improve the flexibility and usability of the sidebar components.

Key Changes

  1. Add new SidebarGroupActions component
  2. Optimize SidebarGroupAction component by adding an absolute prop
  3. Adjust related styles and type definitions

Benefits

  1. Enhanced Flexibility: The new SidebarGroupActions component allows for easier addition of multiple action buttons within sidebar groups. This significantly improves interface design flexibility, enabling developers to freely combine multiple actions as needed.

  2. Improved Customizability: The new absolute prop on the SidebarGroupAction component gives developers more precise control over action button positioning. This provides more options for different layout requirements.

  3. Maintained Consistency: The new component and changes align with the existing design system, ensuring overall UI coherence.

  4. Simplified Development Process: By providing more flexible components, developers can implement complex sidebar layouts more quickly, reducing the need for custom code.

Visual Demonstration

image

Usage Example

<SidebarGroup>
    <SidebarGroupLabel>Feeds</SidebarGroupLabel>
    <SidebarGroupActions>
        <SidebarGroupAction absolute={false} title="Add Feed">
            <Plus />
            <span className="sr-only">Add Feed</span>
        </SidebarGroupAction>
        <SidebarGroupAction absolute={false} title="More">
            <EllipsisVertical />
            <span className="sr-only">More</span>
        </SidebarGroupAction>
    </SidebarGroupActions>
    <SidebarGroupContent>
        {/ Group content /}
    </SidebarGroupContent>
</SidebarGroup>

Summary

These changes not only improve the flexibility and usability of the sidebar components but also lay the foundation for future feature expansions. By providing more customization options, we can better meet various complex UI requirements while maintaining code clarity and maintainability.

Copy link

vercel bot commented Oct 22, 2024

@AiraNadih is attempting to deploy a commit to the shadcn-pro Team on Vercel.

A member of the Team first needs to authorize it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant