ShareModal API

API reference docs for theShareModalwidget. For examples and details on the usage of this widget, visit the widget demo page.

Props

PropsTypeDescriptionDefault
onClosefunctionCallback triggered on closing the share modal and will activate upon pressing "Esc" or clicking on the overlay._
onEscPress?(event: KeyboardEvent) => voidCallback fired when "Esc" key is pressed along with onClose._
onOverlayClick?functionCallback fired when the overlay is clicked along with onClose_
closeOnEsc?booleanIf set to false, the share modal will not close when the Esc key is pressed, and the Esc keydown event along with the onClose callback won't be attached. Similarly, onEscPress will have no effect.true
openbooleanWhen set to true, the dialog will be mounted to DOM._
size?numberThe size of the Modal 'Dialog' box in pixels.640
togglePoint?numberThe screen width at which the modal should switch to a mobile-friendly layout. Deprecated with backwards compatibility ⚠️ (The logic will be handled internally in future)768
mobileFriendly?booleanIndicates if the share modal should be render Sheet in responsive view.true
closeOnOverlayClick?booleanIf set to false, the share modal will not close when the overlay is clicked, and the onClose callback won’t be attached. Similarly, onOverlayClick will have no effect.true
headingImageProps?objectTo render image before the heading, contains label and onClick_
headingImageProps.labelstringAria label content for the image added before the heading._
linkstringLink to be shared_
shareOptions?Array of ObjectsTo have custom share options, If no share options are passed, the default share options will be displayed_
headingImageProps.srcstringUrl content for the image added before the heading._
closeButtonProps?objectTo render and customise share modal close button contains label and onClick_
closeButtonProps.labelstringAria label content for the close Icon button._
closeButtonProps.onClickfunctionCallback function to be invoked when the close button is clicked._