Skip to content

Commit

Permalink
feat: add overlay and content className to dialog part (#114)
Browse files Browse the repository at this point in the history
  • Loading branch information
João Pedro Magalhães committed Apr 11, 2023
1 parent a502db2 commit 3492270
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions cmdk/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ type SeparatorProps = DivProps & {
}
type DialogProps = RadixDialog.DialogProps &
CommandProps & {
/** Provide a className to the Dialog overlay. */
overlayClassName?: string
/** Provide a className to the Dialog content. */
contentClassName?: string
/** Provide a custom element the Dialog should portal into. */
container?: HTMLElement
}
Expand Down Expand Up @@ -792,12 +796,12 @@ const List = React.forwardRef<HTMLDivElement, ListProps>((props, forwardedRef) =
* Renders the command menu in a Radix Dialog.
*/
const Dialog = React.forwardRef<HTMLDivElement, DialogProps>((props, forwardedRef) => {
const { open, onOpenChange, container, ...etc } = props
const { open, onOpenChange, overlayClassName, contentClassName, container, ...etc } = props
return (
<RadixDialog.Root open={open} onOpenChange={onOpenChange}>
<RadixDialog.Portal container={container}>
<RadixDialog.Overlay cmdk-overlay="" />
<RadixDialog.Content aria-label={props.label} cmdk-dialog="">
<RadixDialog.Overlay cmdk-overlay="" className={overlayClassName} />
<RadixDialog.Content aria-label={props.label} cmdk-dialog="" className={contentClassName}>
<Command ref={forwardedRef} {...etc} />
</RadixDialog.Content>
</RadixDialog.Portal>
Expand Down

1 comment on commit 3492270

@vercel
Copy link

@vercel vercel bot commented on 3492270 Apr 11, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

cmdk-website – ./

cmdk-website-git-main-paco.vercel.app
cmdk.vercel.app
cmdk-website-paco.vercel.app
cmdk.paco.me

Please sign in to comment.