Text

Helpers to make working with native text data easier

containsText

Useful to know whether text data ("text/plain") is being dragged. Keep in mind that multiple pieces of native data can be dragged at once.

import { containsText } from '@atlaskit/pragmatic-drag-and-drop/external/text';

dropTargetForExternal({
    element: myElement,
    canDrop: containsText,
});

monitorForExternal({
    canMonitor: containsText,
});

getText

A helper to extract text data ("text/plain") from drop data. Get text will return null when there is no text data.

import { getText } from '@atlaskit/pragmatic-drag-and-drop/external/text';

dropTargetForExternal({
    element: myElement,
    onDrop({ source }) {
        const text: string | null = getText({ source });
    },
});

monitorForExternal({
    onDrop({ source }) {
        const text: string | null = getText({ source });
    },
});
Was this page helpful?
We use this feedback to improve our documentation.
  • Design system
    • Get started
    • Foundations
    • Components
    • Rovo UI
    • Tools
    • Release phases
    • Contact us
© 2026 AtlassianTrademark, (opens new window)Privacy, (opens new window)License