Repository navigation
feat: React Aria Sheet component - #10674
Conversation
|
Build successful! 🎉 |
|
Build successful! 🎉 |
|
Build successful! 🎉 |
|
Build successful! 🎉 |
## API Changes
react-aria-components/react-aria-components:Dialog Dialog {
aria-describedby?: string
aria-details?: string
aria-label?: string
aria-labelledby?: string
children?: ReactNode | (DialogRenderProps) => ReactNode
className?: string = 'react-aria-Dialog'
id?: string
+ isEntering?: boolean
render?: DOMRenderFunction<keyof React.JSX.IntrinsicElements, undefined>
role?: 'dialog' | 'alertdialog' = 'dialog'
slot?: string | null
style?: CSSProperties/react-aria-components:Modal Modal {
children?: ChildrenOrFunction<ModalRenderProps>
className?: ClassNameOrFunction<ModalRenderProps> = 'react-aria-ModalOverlay'
defaultOpen?: boolean
isDismissable?: boolean = false
isEntering?: boolean
isExiting?: boolean
isKeyboardDismissDisabled?: boolean = false
isOpen?: boolean
+ onEnter?: (HTMLElement) => void | Promise<void>
+ onExit?: (HTMLElement) => void | Promise<void>
onOpenChange?: (boolean) => void
render?: DOMRenderFunction<keyof React.JSX.IntrinsicElements, ModalRenderProps>
shouldCloseOnInteractOutside?: (Element) => boolean
slot?: string | null
}/react-aria-components:ModalOverlay ModalOverlay {
children?: ChildrenOrFunction<ModalRenderProps>
className?: ClassNameOrFunction<ModalRenderProps> = 'react-aria-ModalOverlay'
defaultOpen?: boolean
isDismissable?: boolean = false
isEntering?: boolean
isExiting?: boolean
isKeyboardDismissDisabled?: boolean = false
isOpen?: boolean
+ onEnter?: (HTMLElement) => void | Promise<void>
+ onExit?: (HTMLElement) => void | Promise<void>
onOpenChange?: (boolean) => void
render?: DOMRenderFunction<keyof React.JSX.IntrinsicElements, ModalRenderProps>
shouldCloseOnInteractOutside?: (Element) => boolean
slot?: string | null
}/react-aria-components:DialogProps DialogProps {
aria-describedby?: string
aria-details?: string
aria-label?: string
aria-labelledby?: string
children?: ReactNode | (DialogRenderProps) => ReactNode
className?: string = 'react-aria-Dialog'
id?: string
+ isEntering?: boolean
render?: DOMRenderFunction<keyof React.JSX.IntrinsicElements, undefined>
role?: 'dialog' | 'alertdialog' = 'dialog'
slot?: string | null
style?: CSSProperties/react-aria-components:ModalOverlayProps ModalOverlayProps {
children?: ChildrenOrFunction<ModalRenderProps>
className?: ClassNameOrFunction<ModalRenderProps> = 'react-aria-ModalOverlay'
defaultOpen?: boolean
isDismissable?: boolean = false
isEntering?: boolean
isExiting?: boolean
isKeyboardDismissDisabled?: boolean = false
isOpen?: boolean
+ onEnter?: (HTMLElement) => void | Promise<void>
+ onExit?: (HTMLElement) => void | Promise<void>
onOpenChange?: (boolean) => void
render?: DOMRenderFunction<keyof React.JSX.IntrinsicElements, ModalRenderProps>
shouldCloseOnInteractOutside?: (Element) => boolean
slot?: string | null
}/react-aria-components:SheetTrigger+SheetTrigger {
+ children: ReactNode
+ defaultOpen?: boolean
+ isOpen?: boolean
+ onOpenChange?: (boolean) => void
+}/react-aria-components:SheetOverlay+SheetOverlay {
+ children?: ChildrenOrFunction<SheetRenderProps>
+ className?: ClassNameOrFunction<SheetRenderProps> = 'react-aria-SheetOverlay'
+ defaultOpen?: boolean
+ isOpen?: boolean
+ onOpenChange?: (boolean) => void
+ position?: 'bottom' | 'top' | 'left' | 'right' | 'start' | 'end' | 'center' = 'bottom'
+ preventDismissal?: boolean = false
+ render?: DOMRenderFunction<keyof React.JSX.IntrinsicElements, SheetRenderProps>
+ shouldCloseOnInteractOutside?: (Element) => boolean
+ slot?: string | null
+ snapPoints?: Array<number | string>
+ style?: StyleOrFunction<SheetRenderProps>
+ swipeDirection?: 'bottom' | 'top' | 'vertical' | 'left' | 'right' | 'start' | 'end' | 'horizontal'
+}/react-aria-components:Sheet+Sheet {
+ children?: ChildrenOrFunction<SheetRenderProps>
+ className?: ClassNameOrFunction<SheetRenderProps> = 'react-aria-Sheet'
+ overscrollPadding?: boolean
+ render?: DOMRenderFunction<keyof React.JSX.IntrinsicElements, SheetRenderProps>
+ slot?: string | null
+ stackAnimation?: string
+ style?: StyleOrFunction<SheetRenderProps>
+ swipeAnimation?: string
+ swipeAnimationRange?: {
+ start?: number
+ end?: number
+}
+}/react-aria-components:SheetBackdrop+SheetBackdrop {
+ children?: ChildrenOrFunction<SheetRenderProps>
+ className?: ClassNameOrFunction<SheetRenderProps> = 'react-aria-SheetBackdrop'
+ render?: DOMRenderFunction<keyof React.JSX.IntrinsicElements, SheetRenderProps>
+ style?: StyleOrFunction<SheetRenderProps>
+ swipeAnimation?: string
+ swipeAnimationRange?: {
+ start?: number
+ end?: number
+}
+}/react-aria-components:SheetContent+SheetContent {
+ aria-describedby?: string
+ aria-details?: string
+ aria-label?: string
+ aria-labelledby?: string
+ children?: ReactNode | (DialogRenderProps) => ReactNode
+ className?: string = 'react-aria-SheetContent'
+ id?: string
+ render?: DOMRenderFunction<keyof React.JSX.IntrinsicElements, undefined>
+ role?: 'dialog' | 'alertdialog' = 'dialog'
+ slot?: string | null
+ style?: CSSProperties
+}/react-aria-components:SheetOverlayProps+SheetOverlayProps {
+ children?: ChildrenOrFunction<SheetRenderProps>
+ className?: ClassNameOrFunction<SheetRenderProps> = 'react-aria-SheetOverlay'
+ defaultOpen?: boolean
+ isOpen?: boolean
+ onOpenChange?: (boolean) => void
+ position?: 'bottom' | 'top' | 'left' | 'right' | 'start' | 'end' | 'center' = 'bottom'
+ preventDismissal?: boolean = false
+ render?: DOMRenderFunction<keyof React.JSX.IntrinsicElements, SheetRenderProps>
+ shouldCloseOnInteractOutside?: (Element) => boolean
+ slot?: string | null
+ snapPoints?: Array<number | string>
+ style?: StyleOrFunction<SheetRenderProps>
+ swipeDirection?: 'bottom' | 'top' | 'vertical' | 'left' | 'right' | 'start' | 'end' | 'horizontal'
+}/react-aria-components:SheetProps+SheetProps {
+ children?: ChildrenOrFunction<SheetRenderProps>
+ className?: ClassNameOrFunction<SheetRenderProps> = 'react-aria-Sheet'
+ overscrollPadding?: boolean
+ render?: DOMRenderFunction<keyof React.JSX.IntrinsicElements, SheetRenderProps>
+ slot?: string | null
+ stackAnimation?: string
+ style?: StyleOrFunction<SheetRenderProps>
+ swipeAnimation?: string
+ swipeAnimationRange?: {
+ start?: number
+ end?: number
+}
+}/react-aria-components:SheetRenderProps+SheetRenderProps {
+ hasDescendants: boolean
+ isEntering: boolean
+ isExiting: boolean
+ isExpanded: boolean
+ position: SheetPosition
+ stackIndex: number
+ state: OverlayTriggerState
+ swipeDirection: SheetSwipeDirection
+}/react-aria-components:SheetBackdropProps+SheetBackdropProps {
+ children?: ChildrenOrFunction<SheetRenderProps>
+ className?: ClassNameOrFunction<SheetRenderProps> = 'react-aria-SheetBackdrop'
+ render?: DOMRenderFunction<keyof React.JSX.IntrinsicElements, SheetRenderProps>
+ style?: StyleOrFunction<SheetRenderProps>
+ swipeAnimation?: string
+ swipeAnimationRange?: {
+ start?: number
+ end?: number
+}
+}/react-aria-components:SheetContentProps+SheetContentProps {
+ aria-describedby?: string
+ aria-details?: string
+ aria-label?: string
+ aria-labelledby?: string
+ children?: ReactNode | (DialogRenderProps) => ReactNode
+ className?: string = 'react-aria-SheetContent'
+ id?: string
+ render?: DOMRenderFunction<keyof React.JSX.IntrinsicElements, undefined>
+ role?: 'dialog' | 'alertdialog' = 'dialog'
+ slot?: string | null
+ style?: CSSProperties
+}/react-aria-components:SheetTriggerProps+SheetTriggerProps {
+ children: ReactNode
+ defaultOpen?: boolean
+ isOpen?: boolean
+ onOpenChange?: (boolean) => void
+}@react-aria/dialog/@react-aria/dialog:AriaDialogProps AriaDialogProps {
aria-describedby?: string
aria-details?: string
aria-label?: string
aria-labelledby?: string
id?: string
+ isEntering?: boolean
role?: 'dialog' | 'alertdialog' = 'dialog'
}@react-aria/overlays/@react-aria/overlays:AriaModalOverlayProps AriaModalOverlayProps {
isDismissable?: boolean = false
+ isEntering?: boolean
isKeyboardDismissDisabled?: boolean = false
shouldCloseOnInteractOutside?: (Element) => boolean
}@react-aria/utils/@react-aria/utils:useEnterAnimation useEnterAnimation {
ref: RefObject<HTMLElement | null>
isReady: boolean
+ onEnter?: (HTMLElement) => void | Promise<void>
returnVal: undefined
}/@react-aria/utils:useExitAnimation useExitAnimation {
ref: RefObject<HTMLElement | null>
isOpen: boolean
+ onExit?: (HTMLElement) => void | Promise<void>
returnVal: undefined
}@react-spectrum/dialog/@react-spectrum/dialog:Dialog Dialog {
UNSAFE_className?: string
UNSAFE_style?: CSSProperties
alignSelf?: Responsive<'auto' | 'normal' | 'start' | 'end' | 'center' | 'flex-start' | 'flex-end' | 'self-start' | 'self-end' | 'stretch'>
aria-describedby?: string
aria-details?: string
aria-label?: string
aria-labelledby?: string
bottom?: Responsive<DimensionValue>
children: ReactNode
end?: Responsive<DimensionValue>
flex?: Responsive<string | number | boolean>
flexBasis?: Responsive<number | string>
flexGrow?: Responsive<number>
flexShrink?: Responsive<number>
gridArea?: Responsive<string>
gridColumn?: Responsive<string>
gridColumnEnd?: Responsive<string>
gridColumnStart?: Responsive<string>
gridRow?: Responsive<string>
gridRowEnd?: Responsive<string>
gridRowStart?: Responsive<string>
height?: Responsive<DimensionValue>
id?: string
isDismissable?: boolean
+ isEntering?: boolean
isHidden?: Responsive<boolean>
justifySelf?: Responsive<'auto' | 'normal' | 'start' | 'end' | 'flex-start' | 'flex-end' | 'self-start' | 'self-end' | 'center' | 'left' | 'right' | 'stretch'>
left?: Responsive<DimensionValue>
margin?: Responsive<DimensionValue>
marginEnd?: Responsive<DimensionValue>
marginStart?: Responsive<DimensionValue>
marginTop?: Responsive<DimensionValue>
marginX?: Responsive<DimensionValue>
marginY?: Responsive<DimensionValue>
maxHeight?: Responsive<DimensionValue>
maxWidth?: Responsive<DimensionValue>
minHeight?: Responsive<DimensionValue>
minWidth?: Responsive<DimensionValue>
onDismiss?: () => void
order?: Responsive<number>
position?: Responsive<'static' | 'relative' | 'absolute' | 'fixed' | 'sticky'>
right?: Responsive<DimensionValue>
role?: 'dialog' | 'alertdialog' = 'dialog'
size?: 'S' | 'M' | 'L'
start?: Responsive<DimensionValue>
top?: Responsive<DimensionValue>
width?: Responsive<DimensionValue>
zIndex?: Responsive<number>
}/@react-spectrum/dialog:SpectrumDialogProps SpectrumDialogProps {
UNSAFE_className?: string
UNSAFE_style?: CSSProperties
alignSelf?: Responsive<'auto' | 'normal' | 'start' | 'end' | 'center' | 'flex-start' | 'flex-end' | 'self-start' | 'self-end' | 'stretch'>
aria-describedby?: string
aria-details?: string
aria-label?: string
aria-labelledby?: string
bottom?: Responsive<DimensionValue>
children: ReactNode
end?: Responsive<DimensionValue>
flex?: Responsive<string | number | boolean>
flexBasis?: Responsive<number | string>
flexGrow?: Responsive<number>
flexShrink?: Responsive<number>
gridArea?: Responsive<string>
gridColumn?: Responsive<string>
gridColumnEnd?: Responsive<string>
gridColumnStart?: Responsive<string>
gridRow?: Responsive<string>
gridRowEnd?: Responsive<string>
gridRowStart?: Responsive<string>
height?: Responsive<DimensionValue>
id?: string
isDismissable?: boolean
+ isEntering?: boolean
isHidden?: Responsive<boolean>
justifySelf?: Responsive<'auto' | 'normal' | 'start' | 'end' | 'flex-start' | 'flex-end' | 'self-start' | 'self-end' | 'center' | 'left' | 'right' | 'stretch'>
left?: Responsive<DimensionValue>
margin?: Responsive<DimensionValue>
marginEnd?: Responsive<DimensionValue>
marginStart?: Responsive<DimensionValue>
marginTop?: Responsive<DimensionValue>
marginX?: Responsive<DimensionValue>
marginY?: Responsive<DimensionValue>
maxHeight?: Responsive<DimensionValue>
maxWidth?: Responsive<DimensionValue>
minHeight?: Responsive<DimensionValue>
minWidth?: Responsive<DimensionValue>
onDismiss?: () => void
order?: Responsive<number>
position?: Responsive<'static' | 'relative' | 'absolute' | 'fixed' | 'sticky'>
right?: Responsive<DimensionValue>
role?: 'dialog' | 'alertdialog' = 'dialog'
size?: 'S' | 'M' | 'L'
start?: Responsive<DimensionValue>
top?: Responsive<DimensionValue>
width?: Responsive<DimensionValue>
zIndex?: Responsive<number>
}@react-spectrum/overlays/@react-spectrum/overlays:Modal Modal {
UNSAFE_className?: string
UNSAFE_style?: CSSProperties
alignSelf?: Responsive<'auto' | 'normal' | 'start' | 'end' | 'center' | 'flex-start' | 'flex-end' | 'self-start' | 'self-end' | 'stretch'>
bottom?: Responsive<DimensionValue>
children: ReactNode
container?: Element
disableFocusManagement?: boolean
end?: Responsive<DimensionValue>
flex?: Responsive<string | number | boolean>
flexBasis?: Responsive<number | string>
flexGrow?: Responsive<number>
flexShrink?: Responsive<number>
gridArea?: Responsive<string>
gridColumn?: Responsive<string>
gridColumnEnd?: Responsive<string>
gridColumnStart?: Responsive<string>
gridRow?: Responsive<string>
gridRowEnd?: Responsive<string>
gridRowStart?: Responsive<string>
height?: Responsive<DimensionValue>
isDismissable?: boolean = false
+ isEntering?: boolean
isHidden?: Responsive<boolean>
isKeyboardDismissDisabled?: boolean = false
isOpen?: boolean
justifySelf?: Responsive<'auto' | 'normal' | 'start' | 'end' | 'flex-start' | 'flex-end' | 'self-start' | 'self-end' | 'center' | 'left' | 'right' | 'stretch'>
margin?: Responsive<DimensionValue>
marginBottom?: Responsive<DimensionValue>
marginEnd?: Responsive<DimensionValue>
marginStart?: Responsive<DimensionValue>
marginTop?: Responsive<DimensionValue>
marginX?: Responsive<DimensionValue>
marginY?: Responsive<DimensionValue>
maxHeight?: Responsive<DimensionValue>
maxWidth?: Responsive<DimensionValue>
minHeight?: Responsive<DimensionValue>
minWidth?: Responsive<DimensionValue>
onEnter?: () => void
onEntered?: () => void
onEntering?: () => void
onExit?: () => void
onExited?: () => void
onExiting?: () => void
order?: Responsive<number>
position?: Responsive<'static' | 'relative' | 'absolute' | 'fixed' | 'sticky'>
right?: Responsive<DimensionValue>
shouldCloseOnInteractOutside?: (Element) => boolean
start?: Responsive<DimensionValue>
state: OverlayTriggerState
top?: Responsive<DimensionValue>
type?: 'modal' | 'fullscreen' | 'fullscreenTakeover'
width?: Responsive<DimensionValue>
zIndex?: Responsive<number>
}/@react-spectrum/overlays:Tray Tray {
UNSAFE_className?: string
UNSAFE_style?: CSSProperties
alignSelf?: Responsive<'auto' | 'normal' | 'start' | 'end' | 'center' | 'flex-start' | 'flex-end' | 'self-start' | 'self-end' | 'stretch'>
bottom?: Responsive<DimensionValue>
children: ReactNode
container?: Element
disableFocusManagement?: boolean
end?: Responsive<DimensionValue>
flex?: Responsive<string | number | boolean>
flexBasis?: Responsive<number | string>
flexGrow?: Responsive<number>
flexShrink?: Responsive<number>
gridArea?: Responsive<string>
gridColumn?: Responsive<string>
gridColumnEnd?: Responsive<string>
gridColumnStart?: Responsive<string>
gridRow?: Responsive<string>
gridRowEnd?: Responsive<string>
gridRowStart?: Responsive<string>
height?: Responsive<DimensionValue>
isDismissable?: boolean = false
+ isEntering?: boolean
isFixedHeight?: boolean
isHidden?: Responsive<boolean>
isKeyboardDismissDisabled?: boolean = false
isOpen?: boolean
left?: Responsive<DimensionValue>
margin?: Responsive<DimensionValue>
marginBottom?: Responsive<DimensionValue>
marginEnd?: Responsive<DimensionValue>
marginStart?: Responsive<DimensionValue>
marginTop?: Responsive<DimensionValue>
marginX?: Responsive<DimensionValue>
marginY?: Responsive<DimensionValue>
maxHeight?: Responsive<DimensionValue>
maxWidth?: Responsive<DimensionValue>
minHeight?: Responsive<DimensionValue>
minWidth?: Responsive<DimensionValue>
onEnter?: () => void
onEntered?: () => void
onEntering?: () => void
onExit?: () => void
onExited?: () => void
onExiting?: () => void
order?: Responsive<number>
position?: Responsive<'static' | 'relative' | 'absolute' | 'fixed' | 'sticky'>
right?: Responsive<DimensionValue>
shouldCloseOnInteractOutside?: (Element) => boolean
start?: Responsive<DimensionValue>
state: OverlayTriggerState
top?: Responsive<DimensionValue>
width?: Responsive<DimensionValue>
zIndex?: Responsive<number>
}@react-spectrum/s2/@react-spectrum/s2:ContextualHelpPopover ContextualHelpPopover {
UNSAFE_className?: UnsafeClassName
UNSAFE_style?: CSSProperties
aria-describedby?: string
aria-details?: string
aria-label?: string
aria-labelledby?: string
children: ReactNode
containerPadding?: number = 12
crossOffset?: number = 0
getTargetRect?: (Element) => DOMRect | null | undefined = target.getBoundingClientRect()
hideArrow?: boolean = false
id?: string
+ isEntering?: boolean
isOpen?: boolean
offset?: number = 8
onOpenChange?: (boolean) => void
padding?: 'default' | 'none' = 'default'
role?: 'dialog' | 'alertdialog' = 'dialog'
shouldFlip?: boolean = true
size?: 'S' | 'M' | 'L'
slot?: string | null
styles?: PopoverStylesProp
triggerRef?: RefObject<Element | null>
}/@react-spectrum/s2:Dialog Dialog {
UNSAFE_className?: UnsafeClassName
UNSAFE_style?: CSSProperties
aria-describedby?: string
aria-details?: string
aria-label?: string
aria-labelledby?: string
children?: ReactNode | (DialogRenderProps) => ReactNode
id?: string
isDismissible?: boolean
+ isEntering?: boolean
isKeyboardDismissDisabled?: boolean
role?: 'dialog' | 'alertdialog' = 'dialog'
size?: 'S' | 'M' | 'L' | 'XL' = 'M'
slot?: string | null
}/@react-spectrum/s2:CustomDialog CustomDialog {
UNSAFE_className?: UnsafeClassName
UNSAFE_style?: CSSProperties
aria-describedby?: string
aria-details?: string
aria-label?: string
aria-labelledby?: string
children?: ReactNode | (DialogRenderProps) => ReactNode
id?: string
isDismissible?: boolean
+ isEntering?: boolean
isKeyboardDismissDisabled?: boolean
padding?: 'default' | 'none' = 'default'
role?: 'dialog' | 'alertdialog' = 'dialog'
size?: 'S' | 'M' | 'L' | 'fullscreen' | 'fullscreenTakeover'
styles?: StylesProp
}/@react-spectrum/s2:FullscreenDialog FullscreenDialog {
UNSAFE_className?: UnsafeClassName
UNSAFE_style?: CSSProperties
aria-describedby?: string
aria-details?: string
aria-label?: string
aria-labelledby?: string
children?: ReactNode | (DialogRenderProps) => ReactNode
id?: string
+ isEntering?: boolean
isKeyboardDismissDisabled?: boolean
role?: 'dialog' | 'alertdialog' = 'dialog'
slot?: string | null
styles?: StylesProp
}/@react-spectrum/s2:Popover Popover {
UNSAFE_className?: UnsafeClassName
UNSAFE_style?: CSSProperties
aria-describedby?: string
aria-details?: string
aria-label?: string
aria-labelledby?: string
children?: ReactNode
containerPadding?: number = 12
crossOffset?: number = 0
getTargetRect?: (Element) => DOMRect | null | undefined = target.getBoundingClientRect()
hideArrow?: boolean = false
id?: string
+ isEntering?: boolean
isNonModal?: boolean
isOpen?: boolean
offset?: number = 8
onOpenChange?: (boolean) => void
placement?: Placement = 'bottom'
role?: 'dialog' | 'alertdialog' = 'dialog'
shouldFlip?: boolean = true
size?: 'S' | 'M' | 'L'
slot?: string | null
styles?: PopoverStylesProp
triggerRef?: RefObject<Element | null>
}/@react-spectrum/s2:ContextualHelpPopoverProps ContextualHelpPopoverProps {
UNSAFE_className?: UnsafeClassName
UNSAFE_style?: CSSProperties
aria-describedby?: string
aria-details?: string
aria-label?: string
aria-labelledby?: string
children: ReactNode
containerPadding?: number = 12
crossOffset?: number = 0
getTargetRect?: (Element) => DOMRect | null | undefined = target.getBoundingClientRect()
hideArrow?: boolean = false
id?: string
+ isEntering?: boolean
isOpen?: boolean
offset?: number = 8
onOpenChange?: (boolean) => void
padding?: 'default' | 'none' = 'default'
role?: 'dialog' | 'alertdialog' = 'dialog'
shouldFlip?: boolean = true
size?: 'S' | 'M' | 'L'
slot?: string | null
styles?: PopoverStylesProp
triggerRef?: RefObject<Element | null>
}/@react-spectrum/s2:DialogProps DialogProps {
UNSAFE_className?: UnsafeClassName
UNSAFE_style?: CSSProperties
aria-describedby?: string
aria-details?: string
aria-label?: string
aria-labelledby?: string
children?: ReactNode | (DialogRenderProps) => ReactNode
id?: string
isDismissible?: boolean
+ isEntering?: boolean
isKeyboardDismissDisabled?: boolean
role?: 'dialog' | 'alertdialog' = 'dialog'
size?: 'S' | 'M' | 'L' | 'XL' = 'M'
slot?: string | null
}/@react-spectrum/s2:CustomDialogProps CustomDialogProps {
UNSAFE_className?: UnsafeClassName
UNSAFE_style?: CSSProperties
aria-describedby?: string
aria-details?: string
aria-label?: string
aria-labelledby?: string
children?: ReactNode | (DialogRenderProps) => ReactNode
id?: string
isDismissible?: boolean
+ isEntering?: boolean
isKeyboardDismissDisabled?: boolean
padding?: 'default' | 'none' = 'default'
role?: 'dialog' | 'alertdialog' = 'dialog'
size?: 'S' | 'M' | 'L' | 'fullscreen' | 'fullscreenTakeover'
styles?: StylesProp
}/@react-spectrum/s2:FullscreenDialogProps FullscreenDialogProps {
UNSAFE_className?: UnsafeClassName
UNSAFE_style?: CSSProperties
aria-describedby?: string
aria-details?: string
aria-label?: string
aria-labelledby?: string
children?: ReactNode | (DialogRenderProps) => ReactNode
id?: string
+ isEntering?: boolean
isKeyboardDismissDisabled?: boolean
role?: 'dialog' | 'alertdialog' = 'dialog'
slot?: string | null
styles?: StylesProp
} |
| function StandaloneSheet(props) { | ||
| return ( | ||
| <SheetOverlay data-testid="overlay" {...props}> | ||
| <SheetBackdrop data-testid="backdrop" /> | ||
| <Sheet data-testid="sheet"> | ||
| <SheetContent> | ||
| {({close}) => ( | ||
| <> | ||
| <Heading slot="title">Sheet title</Heading> | ||
| <Button onPress={close}>Close</Button> | ||
| </> | ||
| )} | ||
| </SheetContent> | ||
| </Sheet> | ||
| </SheetOverlay> | ||
| ); | ||
| } | ||
|
|
There was a problem hiding this comment.
Re: Support sheets without a trigger
I think there needs to be an accessible fallback for swipe gestures. This is why the native proposal I linked decided to use invoker commands API over CSS. See #10674 (review).
There was a problem hiding this comment.
The close button should cover that, no?
There was a problem hiding this comment.
Oof, thats a good question. I don't believe it does, because we would be relying on user land to provide accessibility. I don't think thats something there is precedent for in react aria? Maybe a hidden button does the trick already, but it would definitely be better to consult with an accessibility engineer.
There was a problem hiding this comment.
You can also tap outside, same as popover and modal. And when non-dismissible, it's the same for all users. We also have a hidden dismiss button for screen readers.
There was a problem hiding this comment.
I mean, it sounds fine to me but again, I'm not the one to ask here 😅 . A quick skimp over the open ui guides for this interaction pattern reads like the trigger is pretty fundamental for discoverability and more, see https://open-ui.org/components/overscroll-actions.explainer/#accessibility-considerations.
There was a problem hiding this comment.
oh I think this is something different. I think they are talking about opening the sheet via a button rather than a gesture. We don't have a builtin gesture for opening a sheet. It's either attached to a SheetTrigger (a button) or controlled by external state. What I was mentioning above was how to close the sheet, which appears to be the same in the proposal (tap the backdrop).
There was a problem hiding this comment.
Yeah no I got that, I was referring to accessibility being a problem if that external state isnt driven by a trigger element or is misplaced in the tab sequence. We are basically leaving the door open for an accessibility problem created in user land. From a design perspective I would love a button-less sheet (or one triggered by any pressable), lol.
There was a problem hiding this comment.
I don't think it's any different than controlling a Modal or Popover via external state, which we already support. It would be problematic as they describe in open-ui if you could open the sheet via a swipe gesture but not via a button. Sure, someone could implement that themselves using the controlled isOpen prop, but that's not really our problem. There are plenty of inaccessible things you can implement even when using accessible component libraries.
Cancelling an animation rejects its finished promise, so Promise.all in useAnimation rejected and onEnd never ran, leaving exiting overlays mounted. Wait for every promise to settle instead, as adobe#9772 did. Settling on cancellation means an interrupted run (e.g. an overlay reopened while exiting) could end a later one, which the effect cleanup removed in adobe#10674 used to prevent. Track the current run in a ref instead of restoring that cleanup, since StrictMode re-runs the effect on mount and the isActiveRef guard would skip restarting it. Closes adobe#10772 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Cancelling an animation rejects its finished promise, so Promise.all in useAnimation rejected and onEnd never ran, leaving exiting overlays mounted. Wait for every promise to settle instead, as adobe#9772 did. Settling on cancellation means an interrupted run (e.g. an overlay reopened while exiting) could end a later one, which the effect cleanup removed in adobe#10674 used to prevent. Track the current run in a ref instead of restoring that cleanup, since StrictMode re-runs the effect on mount and the isActiveRef guard would skip restarting it. Closes adobe#10772 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Cancelling an animation rejects its finished promise, so Promise.all in useAnimation rejected and onEnd never ran, leaving exiting overlays mounted. Wait for every promise to settle instead, as adobe#9772 did. Settling on cancellation means an interrupted run (e.g. an overlay reopened while exiting) could end a later one, which the effect cleanup removed in adobe#10674 used to prevent. Track the current run in a ref instead of restoring that cleanup, since StrictMode re-runs the effect on mount and the isActiveRef guard would skip restarting it. Closes adobe#10772 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Cancelling an animation rejects its finished promise, so Promise.all in useAnimation rejected and onEnd never ran, leaving exiting overlays mounted. Wait for every promise to settle instead, as adobe#9772 did. Settling on cancellation means an interrupted run (e.g. an overlay reopened while exiting) could end a later one, which the effect cleanup removed in adobe#10674 used to prevent. Track the current run in a ref instead of restoring that cleanup, since StrictMode re-runs the effect on mount and the isActiveRef guard would skip restarting it. Closes adobe#10772 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Cancelling an animation rejects its finished promise, so Promise.all in useAnimation rejected and onEnd never ran, leaving exiting overlays mounted. Wait for every promise to settle instead, as adobe#9772 did. Settling on cancellation means an interrupted run (e.g. an overlay reopened while exiting) could end a later one, which the effect cleanup removed in adobe#10674 used to prevent. Track the current run in a ref instead of restoring that cleanup, since StrictMode re-runs the effect on mount and the isActiveRef guard would skip restarting it. Closes adobe#10772 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This adds a new
Sheetcomponent to react-aria-components. A Sheet is a swipeable overlay that slides in from the edge of the viewport. It supports snap points, stacking, gesture-synchronized animations, overscroll padding, and multiple placements and swipe directions.It's implemented entirely with native browser scroll gestures, on top of CSS scroll snapping and view timelines, which means it runs at native 120fps without any JavaScript touch handling. Below is a diagram illustrating how it works:
Assuming
position="bottom":scrollTo({top: '100vh', behavior: 'smooth'}). This create the entering animation.swipeAnimation, which is a CSS animation synchronized with the swipe gesture. This uses CSS view-timeline, which tracks how much of an element is visible and uses this to drive a keyframe animation. The timeline ids are defined at thehtmlelement so that any element on the page can use them, and attached to theSheetContentelement.stackAnimation. One or more instances of this animation are applied at once, depending on how many sheets are in front.animation-composition: accumulatecombines their effects together, so for each sheet the stack depth increases. These also use the timeline of each sheet in the stack so they are synced with the swipe gesture.snapPoints. These are divs rendered inside the stage. They are defined as how much of the sheet is visible. This is done by absolutely positioning them with a scroll margin of one viewport.Note: in Firefox, view-timeline is not yet supported (though they just announced it is shipping soon). In this case, we drive the swipeAnimation with a fixed duration during enter/exit, but it is not synced with the swipe gesture.