diff --git a/docs/api/modal.md b/docs/api/modal.md
index 1249e2a813b..2b3868b8190 100644
--- a/docs/api/modal.md
+++ b/docs/api/modal.md
@@ -210,6 +210,26 @@ A few things to keep in mind when creating custom dialogs:
* `ion-content` is intended to be used in full-page modals, cards, and sheets. If your custom dialog has a dynamic or unknown size, `ion-content` should not be used.
* Creating custom dialogs provides a way of ejecting from the default modal experience. As a result, custom dialogs should not be used with card or sheet modals.
+## Event Handling
+
+### Using `ionDragStart` and `ionDragEnd`
+
+The `ionDragStart` event is emitted as soon as the user begins a dragging gesture on the modal. This event fires at the moment the user initiates contact with the handle or modal surface, before any actual displacement occurs. It is particularly useful for preparing the interface for a transition, such as hiding certain interactive elements (like headers or buttons) to ensure a smooth dragging experience.
+
+The `ionDragEnd` event is emitted when the user completes the dragging gesture by releasing the modal. Like the move event, it includes the final [`ModalDragEventDetail`](#modaldrageventdetail) object. This event is commonly used to finalize state changes once the modal has come to a rest.
+
+import DragStartEndEvents from '@site/static/usage/v8/modal/drag-start-end-events/index.md';
+
+
+
+### Using `ionDragMove`
+
+The `ionDragMove` event is emitted continuously while the user is actively dragging the modal. This event provides a [`ModalDragEventDetail`](#modaldrageventdetail) object containing real-time data, essential for creating highly responsive UI updates that react instantly to the user's touch. For example, the `progress` value can be used to dynamically darken a header's opacity as the modal is dragged upward.
+
+import DragMoveEvent from '@site/static/usage/v8/modal/drag-move-event/index.md';
+
+
+
## Interfaces
### ModalOptions
@@ -251,6 +271,59 @@ interface ModalCustomEvent extends CustomEvent {
}
```
+### ModalDragEventDetail
+
+When using the `ionDragMove` and `ionDragEnd` events, the event detail contains the following properties:
+
+```typescript
+interface ModalDragEventDetail {
+ /**
+ * The current Y position of the modal.
+ *
+ * This can be used to determine how far the modal has been dragged.
+ */
+ currentY: number;
+ /**
+ * The change in Y position since the gesture started.
+ *
+ * This can be used to determine the direction of the drag.
+ */
+ deltaY: number;
+ /**
+ * The velocity of the drag in the Y direction.
+ *
+ * This can be used to determine how fast the modal is being dragged.
+ */
+ velocityY: number;
+ /**
+ * A number between 0 and 1.
+ *
+ * In a sheet modal, progress represents the relative position between
+ * the lowest and highest defined breakpoints.
+ *
+ * In a card modal, it measures the relative position between the
+ * bottom of the screen and the top of the modal when it is fully
+ * open.
+ *
+ * This can be used to style content based on how far the modal has
+ * been dragged.
+ */
+ progress: number;
+ /**
+ * If the modal is a sheet modal, this will be the breakpoint that
+ * the modal will snap to if the user lets go of the modal at the
+ * current moment.
+ *
+ * If it's a card modal, this property will not be included in the
+ * event payload.
+ *
+ * This can be used to style content based on where the modal will
+ * snap to upon release.
+ */
+ snapBreakpoint?: number;
+}
+```
+
## Accessibility
### Keyboard Interactions
diff --git a/static/usage/v8/modal/drag-move-event/angular/example_component_html.md b/static/usage/v8/modal/drag-move-event/angular/example_component_html.md
new file mode 100644
index 00000000000..6ba672f6040
--- /dev/null
+++ b/static/usage/v8/modal/drag-move-event/angular/example_component_html.md
@@ -0,0 +1,27 @@
+```html
+
+
+ App
+
+
+
+ Open Sheet Modal
+
+
+
+
+
+ Drag the handle to adjust the header's visibility.
+
+
+
+
+
+```
diff --git a/static/usage/v8/modal/drag-move-event/angular/example_component_ts.md b/static/usage/v8/modal/drag-move-event/angular/example_component_ts.md
new file mode 100644
index 00000000000..cf49b23a974
--- /dev/null
+++ b/static/usage/v8/modal/drag-move-event/angular/example_component_ts.md
@@ -0,0 +1,75 @@
+```ts
+import { Component, ElementRef, ViewChild } from '@angular/core';
+import { IonButton, IonContent, IonHeader, IonLabel, IonModal, IonTitle, IonToolbar } from '@ionic/angular/standalone';
+import type { ModalDragEventDetail } from '@ionic/angular/standalone';
+
+@Component({
+ selector: 'app-example',
+ templateUrl: 'example.component.html',
+ standalone: true,
+ imports: [IonButton, IonContent, IonHeader, IonLabel, IonModal, IonTitle, IonToolbar],
+})
+export class ExampleComponent {
+ @ViewChild('header', { read: ElementRef })
+ header!: ElementRef;
+ // Assign the current snap breakpoint to the initial breakpoint so
+ // that we can track changes during the drag
+ currentSnap = 0.25;
+
+ onDragMove(event: CustomEvent) {
+ // `progress` is a value from 1 (top) to 0 (bottom)
+ // `snapBreakpoint` tells us which snap point the modal will animate to after the drag ends
+ const { progress, snapBreakpoint } = event.detail;
+
+ if (this.currentSnap !== snapBreakpoint) {
+ this.currentSnap = snapBreakpoint as number;
+
+ console.log('Current snap breakpoint:', snapBreakpoint);
+ }
+
+ const headerEl = this.header.nativeElement;
+ /**
+ * Inverse relationship:
+ * 1.0 progress = 0 opacity
+ * 0 progress = 1.0 opacity
+ */
+ const currentOpacity = 1 - progress;
+
+ headerEl.style.opacity = currentOpacity.toString();
+ }
+
+ onDragEnd(event: CustomEvent) {
+ // `progress` is a value from 1 (top) to 0 (bottom)
+ // `snapBreakpoint` tells us which snap point the modal will animate to after the drag ends
+ const { progress, snapBreakpoint } = event.detail;
+ const headerEl = this.header.nativeElement;
+
+ /**
+ * If the modal is snapping to the closed state (0), reset the
+ * styles.
+ */
+ if (snapBreakpoint === 0) {
+ headerEl.style.removeProperty('opacity');
+ headerEl.style.removeProperty('transition');
+ return;
+ }
+
+ // Smooth transition to the final resting opacity
+ headerEl.style.transition = 'opacity 0.4s ease';
+ // The final opacity matches the inverse of the resting progress
+ headerEl.style.opacity = (1 - progress).toString();
+ }
+
+ /**
+ * If the user dismisses the modal (e.g. tapping the backdrop),
+ * reset the styles.
+ */
+ onWillDismiss() {
+ const headerEl = this.header.nativeElement;
+
+ // Reset styles when the modal is dismissed
+ headerEl.style.removeProperty('opacity');
+ headerEl.style.removeProperty('transition');
+ }
+}
+```
diff --git a/static/usage/v8/modal/drag-move-event/demo.html b/static/usage/v8/modal/drag-move-event/demo.html
new file mode 100644
index 00000000000..ec285ca79ed
--- /dev/null
+++ b/static/usage/v8/modal/drag-move-event/demo.html
@@ -0,0 +1,93 @@
+
+
+
+
+
+ Modal
+
+
+
+
+
+
+
+
+
+
+ App
+
+
+
+ Open Sheet Modal
+
+
+
+
+ Drag the handle to adjust the header's visibility.
+
+
+
+
+
+
+
+
+
diff --git a/static/usage/v8/modal/drag-move-event/index.md b/static/usage/v8/modal/drag-move-event/index.md
new file mode 100644
index 00000000000..6fbefa4f21b
--- /dev/null
+++ b/static/usage/v8/modal/drag-move-event/index.md
@@ -0,0 +1,29 @@
+import Playground from '@site/src/components/global/Playground';
+
+import javascript from './javascript.md';
+
+import react from './react.md';
+
+import vue from './vue.md';
+
+import angular_example_component_html from './angular/example_component_html.md';
+import angular_example_component_ts from './angular/example_component_ts.md';
+
+
diff --git a/static/usage/v8/modal/drag-move-event/javascript.md b/static/usage/v8/modal/drag-move-event/javascript.md
new file mode 100644
index 00000000000..64d64b70a1f
--- /dev/null
+++ b/static/usage/v8/modal/drag-move-event/javascript.md
@@ -0,0 +1,77 @@
+```html
+
+
+ App
+
+
+
+ Open Sheet Modal
+
+
+
+
+ Drag the handle to adjust the header's visibility.
+
+
+
+
+
+
+```
diff --git a/static/usage/v8/modal/drag-move-event/react.md b/static/usage/v8/modal/drag-move-event/react.md
new file mode 100644
index 00000000000..83d85246e8f
--- /dev/null
+++ b/static/usage/v8/modal/drag-move-event/react.md
@@ -0,0 +1,99 @@
+```tsx
+import React, { useRef } from 'react';
+import { IonButton, IonModal, IonHeader, IonContent, IonToolbar, IonTitle, IonPage, IonLabel } from '@ionic/react';
+import type { ModalDragEventDetail } from '@ionic/react';
+
+function Example() {
+ const header = useRef(null);
+ // Assign the current snap breakpoint to the initial breakpoint so
+ // that we can track changes during the drag
+ const currentSnap = useRef(0.25);
+
+ const onDragMove = (event: CustomEvent) => {
+ // `progress` is a value from 1 (top) to 0 (bottom)
+ // `snapBreakpoint` tells us which snap point the modal will animate to after the drag ends
+ const { progress, snapBreakpoint } = event.detail;
+ const headerEl = header.current!;
+
+ if (currentSnap.current !== snapBreakpoint) {
+ currentSnap.current = snapBreakpoint as number;
+
+ console.log('Current snap breakpoint:', snapBreakpoint);
+ }
+
+ /**
+ * Inverse relationship:
+ * 1.0 progress = 0 opacity
+ * 0 progress = 1.0 opacity
+ */
+ const currentOpacity = 1 - progress;
+
+ headerEl.style.opacity = currentOpacity.toString();
+ };
+
+ const onDragEnd = (event: CustomEvent) => {
+ // `progress` is a value from 1 (top) to 0 (bottom)
+ // `snapBreakpoint` tells us which snap point the modal will animate to after the drag ends
+ const { progress, snapBreakpoint } = event.detail;
+ const headerEl = header.current!;
+
+ /**
+ * If the modal is snapping to the closed state (0), reset the
+ * styles.
+ */
+ if (snapBreakpoint === 0) {
+ headerEl.style.removeProperty('opacity');
+ headerEl.style.removeProperty('transition');
+ return;
+ }
+
+ // Smooth transition to the final resting opacity
+ headerEl.style.transition = 'opacity 0.4s ease';
+ // The final opacity matches the inverse of the resting progress
+ headerEl.style.opacity = (1 - progress).toString();
+ };
+
+ /**
+ * If the user dismisses the modal (e.g. tapping the backdrop),
+ * reset the styles.
+ */
+ const onWillDismiss = () => {
+ const headerEl = header.current!;
+
+ // Reset styles when the modal is dismissed
+ headerEl.style.removeProperty('opacity');
+ headerEl.style.removeProperty('transition');
+ };
+
+ return (
+
+
+
+ App
+
+
+
+
+ Open Sheet Modal
+
+
+
+
+ Drag the handle to adjust the header's visibility.
+