Skip to content
PixiKit

Grow Dialog

A dialog that grows out of the element you clicked while the page behind blurs and dims, and shrinks back into the same element when it closes.

pixikit.com/docs/components/grow-dialog

Customize

Default open
Show trigger
Width750px
Height467px
Radius20px
Padding24px
Duration0.45s
Easing
Motion
Start scale0.80
Backdrop blur15px
Backdrop opacity0.80
Backdrop color
Background color
Border color
Show close
Show arrows
Close on escape
Close on backdrop
Portal
Lock scroll

Props

34
NameTypeDefaultDescription
childrenReactNodeNoneWhat the dialog shows. A sample layout shows when left out.
openbooleanNoneOpen state, when you hold it.
defaultOpenbooleanfalseStarts open.
onOpenChange(open: boolean) => voidNoneCalled when the dialog opens or closes.
originHTMLElement | nullNoneThe element the dialog grows from and returns to. Defaults to the built-in trigger.
showTriggerbooleantrueRenders the built-in trigger button. Turn off when you open it yourself.
triggerLabelstring"Open details"Text of the built-in trigger.
triggerReactNodeNoneCustom trigger content; replaces `triggerLabel`.
titlestring"Star, outline"Dialog name, read by screen readers and shown in the sample layout.
descriptionstring"The dialog starts at the place and size of what you clicked, then settles in the middle while the page behind blurs. Escape sends it back."Text of the sample layout.
widthnumber750Dialog width, in px. It shrinks on narrow screens.
heightnumber467Dialog height, in px; 0 fits the content.
radiusnumber20Corner radius, in px.
paddingnumber24Space inside the dialog, in px.
durationnumber0.45Seconds the dialog takes to grow and to return.
easing"spring" | "ease-out" | "ease""ease-out"How the dialog moves.
motion"grow" | "scale" | "fade""grow"`grow` starts at the origin's place and size, `scale` grows in the middle from `startScale`, `fade` only fades.
startScalenumber0.8Size the dialog starts from with `scale`, as a share of its full size.
backdropBlurnumber15Blur of the page behind, in px.
backdropOpacitynumber0.8Darkness of the page behind, 0 to 1.
backdropColorstring"#000000"Colour laid over the page behind.
backgroundColorstring"var(--background)"Dialog fill.
borderColorstring"var(--border)"Dialog border colour.
showClosebooleantrueShows the round close button.
showArrowsbooleanfalseShows previous and next buttons beside the dialog.
onPrevious() => voidNoneCalled by the previous button and the left arrow key.
onNext() => voidNoneCalled by the next button and the right arrow key.
closeOnEscapebooleantrueCloses on Escape.
closeOnBackdropbooleantrueCloses on a click outside the dialog.
portalbooleantrueRenders into document.body over the whole window. Turn off to keep it inside its container.
lockScrollbooleantrueStops the page from scrolling while open.
closeLabelstring"Close"Screen reader text of the close button.
classNamestring""
styleCSSPropertiesNone

Related