Informer

The @sme-uploader/informer plugin is a pop-up bar for showing notifications. When plugins have some exciting news (or error) to share, they can show a notification here.

Informer gets its data from uploader.state.info, which is updated by various plugins via uploader.info method.

const Informer = require('@sme-uploader/informer')

uploader.use(Informer, {
  // Options
})

Try it live

The Informer plugin is included in the Dashboard by default.

Installation

If you are using the sme-uploader package, you do not need to install this plugin manually.

This plugin is published as the @sme-uploader/informer package.

Install from NPM:

npm install @sme-uploader/informer

In the CDN package, it is available on the SmeUploader global object:

const Informer = SmeUploader.Informer

CSS

The @sme-uploader/informer plugin requires the following CSS for styling:

import '@sme-uploader/core/dist/style.css'
import '@sme-uploader/informer/dist/style.css'

Import general Core styles from @sme-uploader/core/dist/style.css first, then add the Informer styles from @sme-uploader/informer/dist/style.css. A minified version is also available as style.min.css at the same path. The way to do import depends on your build system.

⚠️ If you use the @sme-uploader/dashboard plugin, you do not need to include the styles for the Progress Bar, because the Dashboard already includes it.

Options

The @sme-uploader/informer plugin has the following configurable options:

id: 'Informer'

A unique identifier for this plugin. It defaults to 'Informer'. Use this if you need multiple Informer instances.

target: null

DOM element, CSS selector, or plugin to mount the Informer into.

replaceTargetContent: false

Remove all children of the target element before mounting the Informer. By default, SME Uploader will append any UI to the target DOM element. This is the least dangerous option. However, you may have some fallback HTML inside the target element in case JavaScript or SME Uploader is not available. In that case, you can set replaceTargetContent: true to clear the target before appending.