Skip to content

Conversation

@shabanhr
Copy link
Contributor

@shabanhr shabanhr commented Dec 4, 2025

Overview

This PR adds a new showCloseButton prop to the SheetContent component. This allows developers to conditionally toggle the visibility of the default "X" close button in the upper right corner.

Motivation

Currently, the close button is rendered automatically. There are use cases where developers might want to:

  • Implement a custom close mechanism/button elsewhere in the UI.
  • Prevent users from closing the sheet via the corner button (e.g., during a critical flow).
  • Create a cleaner UI without the default icon.

Usage

The prop defaults to true (current behavior) if undefined, ensuring no breaking changes. To hide the button, simply pass false:

<SheetContent showCloseButton={false}>
  <SheetHeader>
    <SheetTitle>Edit profile</SheetTitle>
    <SheetDescription>
      Make changes to your profile here.
    </SheetDescription>
  </SheetHeader>
  {/* Content */}
</SheetContent>

@vercel
Copy link

vercel bot commented Dec 4, 2025

@shabanhr 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