Skip to content

anydrop-ui ​

The plain-JavaScript AnyDrop UI: drop zone, folder tree and mobile layout on top of the core.

Classes ​

ClassDescription
AnyDropThe AnyDrop UI: a drop zone with file and folder pickers, a folder tree, a toolbar, an error panel, thumbnails and a mobile layout. It extends AnyDropCore, so every core option, method and event works.

Interfaces ​

InterfaceDescription
AnyDropDictThe DOM strings of a UI instance. Every user-visible text is one of these (translatable).
AnyDropErrorItemContextContext of an error panel row.
AnyDropFileContextContext of a file row.
AnyDropFolderContextContext of a folder row.
AnyDropLocaleA language pack: set it with the locale option.
AnyDropMessageContextContext of the drop message (also the empty state).
AnyDropRenderContextMembers every render context has.
AnyDropRenderHooksThe five render hooks.
AnyDropRenderViewA mounted custom view.
AnyDropRowActionA custom row action, or an override of a built-in one (same id).
AnyDropRowActionsThe rowActions option: the buttons of file rows and folder rows.
AnyDropToolbarContextContext of the toolbar.
AnyDropUIOptionsThe DOM strings of a UI instance. Every user-visible text is one of these (translatable).
MockFileA file-like object for displayExistingFile(): not part of the tree or the upload queue.

Type Aliases ​

Type AliasDescription
AnyDropConfigWhat the constructor and setOption accept.
AnyDropFileActionThe built-in file row actions.
AnyDropFolderActionThe built-in folder row actions.
AnyDropFullOptions-
AnyDropIconNameThe names of the built-in icons. Custom row actions can use any other name you put in icons.
AnyDropIconsIcons as SVG markup, by name, or a function that returns markup or an element per name (null or undefined = the built-in icon). Icons are trusted developer input, never user data.
AnyDropLayoutHow files are laid out. list is the default, compact is a dense list.
AnyDropRenderHookA render hook: runs with this = the instance.
AnyDropRenderResultWhat a render hook may return: an element, a view, text, or nothing (keep the default content).
AnyDropTextsEvery text of the UI and core (dict* options), except dictRemoveFileConfirmation.
ElementRef-

Variables ​

VariableDescription
DEFAULT_TEMPLATEThe default preview template. data-ad-* attributes mark the parts that get filled in.

Functions ​

FunctionDescription
uiDefaultsThe default UI options (a fresh object each call).

References ​

VERSION ​

Re-exports VERSION

Released under the MIT License.