What it does

UI included

Replicates the Bynder look and feel. Search, filter, sort and select are all built in - no design work required.

Auth handled

Works with all Bynder and WebDAM auth methods. Pass an existing access token to skip the login screen entirely.

Flexible modes

Single select, multi-select, or file-level selection. Open as a modal or mount in a container element on your page.

Configurable

Pre-set a portal, lock asset types, apply a custom theme, prefill filters and pre-select assets via config.

See the Universal Compact View in action

The Universal Compact View is the easiest way to get assets from the DAM into your web application. It's a component built with Typescript that allows developers to add support for selecting and importing assets from the DAM without having to worry about the intricacies related to building a file picker: UI design, authentication, API requests, etc. This component fetches the assets and their metadata through the API's and renders it by replicating the Bynder look & feel. Users can query, filter (by smartfilters, metaproperties, tags, keyword, and existing collections), sort, and select assets to then import them into another application.

Universal Compact View works with all methods of authentication that your Bynder and WebDAM portal supports.

Universal Compact View on Bynder Knowledge Base

Demo

For a demo of the Universal Compact View latest version and its configuration options check out our demo page at https://bynder.github.io/bynder-compactview/.

Screenshots

UCV screenshot UCV screenshot

Example Usage

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <title>Universal Compact View</title>
  </head>
  <body>
    <div id="importedAssets"></div>
    <script src="https://ucv.bynder.com/5.0.5/modules/compactview/bynder-compactview-5-latest.js"></script>
    <script>
      BynderCompactView.open({
        language: "en_US",
        theme: {
          colorButtonPrimary: "#3380FF"
        },
        mode: "SingleSelectFile",
        onSuccess: function(assets, additionalInfo) {
          var importedAssetsContainer = document.getElementById(
            "importedAssets"
          );
          importedAssetsContainer.innerHTML = "";

          var asset = assets[0];

          console.log(asset, additionalInfo);

          switch (asset.type) {
            case "IMAGE":
              importedAssetsContainer.innerHTML +=
                "<img src=" + additionalInfo.selectedFile.url + " />";
              return;
            case "AUDIO":
            case "DOCUMENT":
              importedAssetsContainer.innerHTML +=
                "<img src=" + asset.files.webImage.url + " />";
              return;
            case "VIDEO":
              importedAssetsContainer.innerHTML +=
                '<video width="640" height="480" controls>' +
                '<source src="' +
                asset.previewUrls[0] +
                '" type="video/webm">' +
                "</video>";
              return;
            default:
              return;
          }
        }
      });
    </script>
  </body>
</html>

Once the assets are selected, they are submitted by the Universal Compact View using CustomEvents. They will be returned in an array of objects that can be handled in your page. In the example above we use a div with id importedAssets that will be filled with the assets urls. This response array contains all of the information about the assets from the Bynder portal, including all public derivatives.

List of available asset derivatives can be retrieved by the API call: Retrieve Derivatives.

https://codesandbox.io/p/sandbox/ucv-examplpe-app-rhtqrj

How it works

We have two available methods available for implementing the UCV. Either the Cloudfront distribution URL can be used or you can download the NPM package.

Recommended

npm

Install the package and import BynderCompactView into your app.

npm install @bynder/compact-view

No build step · Latest: 6.1.0

CDN

Add the script tag to any HTML page — no build step needed. The -6-latest.js script always resolves to the latest 6.x release (currently 6.1.0).

<script src="https://ucv.bynder.com/5.0.5/modules/compactview/bynder-compactview-6-latest.js"></script>

Quick start

Open the asset picker with three lines of JavaScript:

BynderCompactView.Open({
  portal: { url: 'your-portal.getbynder.com' },
  onSuccess: function(assets, additionalInfo) {
    console.log(assets);
  }
});

Selected assets are returned as an array via the onSuccess callback. Each object contains the full asset metadata from your portal including all public derivatives. Use assetFieldSelection to limit which fields are returned and reduce payload size.

Try a working example on CodeSandbox ↗.

Configuration

All options are optional unless stated.

OptionPossible ValuesDefaultDescription
onSuccessfunction (assets: array(asset), additionalInfo?: AdditionalInfo): voidconsole.logCallback invoked when assets are confirmed.
Receives (assets: Asset[], additionalInfo?: AdditionalInfo)
portal{url: string, editable: bool}—Portal configuration object
portal.urlA string containing Bynder portal URL—Set a default portal URL for the Compact View login screen set
on the Login component if using the npm package package
portal.editabletrue , falsetrueSet false to lock the component to a single portal
mode"MultiSelect", "SingleSelect", "SingleSelectFile""SingleSelect"Set the Compact View to allow multiple or single asset selection
assetTypes['AUDIO', 'DOCUMENT', 'IMAGE', 'VIDEO']allLimit selectable types: "IMAGE", "VIDEO", "DOCUMENT", "AUDIO"
assetFieldSelectionstringall fieldsMultiline string of GraphQL field names to include in the response.
See Asset field selection below
languagestring"en_US"UI language: "en_US", "nl_NL", "de_DE", "fr_FR", "es_ES"
authentication{ getAccessToken: () => '', hideLogout: false }—Authentication config object.
(Set on the Login component if using the npm package package)
authentication.getAccessToken() => ''—() => string — return an existing
OAuth token to bypass the login flow
authentication.hideLogouttrue, falsefalseHide the logout button. Only valid when
using authentication.getAccessToken
containerA Dom.HTMLElement instance—A DOM element to use as the UCV container (disables modal).
See Container mode
defaultSearchTermstring—Pre-populate the search input on open
selectedAssets["id1", "id2", "id3"][]An array of asset IDs to pre-select.
In non-MultiSelect modes, the last ID is selected
assetFilterAssetFilterJson—Predefined filters applied on open. See AssetFilterJson type below
themeTheme—Override primary colours to match your app. See Theme type below
hideExternalAccesstrue, falsefalseRemove access to external DAM assets and collections
hideLimitedUsetrue, falsefalseIf true, limited assets will be hidden for all users.
selectAllOptiontrue, falsefalseShow a select-all control in MultiSelect mode
hideSwitchtrue, falsefalseProperty to hide switch between Assets and Collections
modalStyles{"width": "100%"}—An object with CSS properties for the modal wrapper, e.g. {"width": "90%"}
onLogout() => void—`Callback, will be fired after logout
noCachetrue, falsefalseProperty to disable frontend cache inside UCV
defaultImageDerivativeNamestring—Case-sensitive name of the image derivative to
pre-select in the response
defaultVideoDerivativeNamestring—Case-sensitive name of the video derivative to
pre-select in the response
isPersonaltrue, falsefalseFilter asset requests to show only personal assets
enableDASHtrue, falsefalseEnable the DASH option in the adaptive video streaming selector
embedTypestring"script"Predefine AVS embed code format: "script" or "iframe"
resetStoreOnMounttrue, falsefalseReset internal state on mount when using container mode
enableDATPermissionManagementtrue, falsefalseThis will enforce permissions for the DAT Transformation UI.
If this is set to 'true', users will only see the DAT Transformation UI
in the UCV if they have the 'Create Transformations' permission
in their Bynder Permission profile.
type AdditionalInfo = { selectedFile?: File }

type File = { url: string; width?: number; height?: number; fileSize?: number; }

type MetapropertyName = string;
type MetapropertyOptionName = string;
type MetapropertyOptionId = string;

type PredefinedMetapropertiesOptionsType = {
        MetapropertyName: { MetapropertyOptionName: MetapropertyOptionId }
    }

type AssetFilterJson = {
    predefinedAssetType?: AssetType[]; //predefined asset types
    collectionId?: string; //predefined collection id. Predefined collection ID should be provided in base64Encoded format (Collection_id 737141DC-7562-49C4-8BD8F6628578028A)
    predefinedMetapropertiesOptions?: PredefinedMetapropertiesOptionsType; //predefined metaproperty IDs
    searchTerm?: string; //predefined search term
    predefinedTagNames?: string[]; //predefined tags
    isLimitedUse?: boolean; //whether or not this asset is marked as Limited Use
    showToolbar?: boolean; //show toolbar for predefined filters (false by default)
};

Predefined 'collection ID' should be provided in base64Encoded format '(Collection_id 737141DC-7562-49C4-8BD8F6628578028A)' = 'KENvbGxlY3Rpb25faWQgNzM3MTQxREMtNzU2Mi00OUM0LThCRDhGNjYyODU3ODAyOEEp'

type AssetType = 'AUDIO' | 'DOCUMENT' | 'IMAGE' | 'VIDEO'

type Theme = {
   colorPrimary?: CSSColor;
   colorButtonPrimary?: CSSColor;
   colorButtonPrimaryLabel?: CSSColor;
   colorButtonPrimaryActive?: CSSColor;
   colorButtonPrimaryHover?: CSSColor;
   colorButtonPrimaryHoverLabel?: CSSColor;
};

Asset field selection

Pass assetFieldSelection as a multiline string of field names to control what the onSuccess callback returns. Requesting only needed fields reduces payload size.

databaseId
name
files
url
tags
textMetaproperties { 
  name 
  value 
}
metaproperties { 
  nodes { 
    name 
    options {
      name 
      displayLabel 
    }
  }
}

For Legacy browsers

"databaseId \
name \
files \
url \
tags \
..."

Fields accepted by assetFieldSelection:

databaseId       name             description      type
url              createdAt        publishedAt      updatedAt
fileSize         height           width            orientation
isArchived       brandId          files            copyright
extensions       isLimitedUse     isPublic         isWatermarked
tags             originalUrl
metaproperties { nodes { ... } }
textMetaproperties { name value }

Asset response

onSuccess receives (assets: Asset[], additionalInfo?: AdditionalInfo). Full asset type:

interface Asset {

    # Asset ID.
    id:  ID! 

    # Asset database Id.
    databaseId:  String! 

    # Asset name.
    name:  String! 

    # Asset description.
    description:  String 

    # Asset type. Possible values are: IMAGE, DOCUMENT, AUDIO and VIDEO.
    type:  AssetType! 

    # The HTTP URL for this payload.asset.
    url:  URI! 

    # Date created.
    createdAt:  DateTime! 

    # User who created the payload.asset.
    createdBy:  User 

    # Date published.
    publishedAt:  DateTime 

    # Date updated.
    updatedAt:  DateTime 

    # Size of the asset file in bytes.
    fileSize:  Int! 

    # Height of the original asset file.
    height:  Int! 

    # Width of the original asset file.
    width:  Int! 

    # Asset orientation. Possible values are: PORTRAIT, LANDSCAPE, SQUARE.
    orientation:  Orientation! 

    # Whether or not this asset is archived.
    #
    # Knowledge base entry
    isArchived:  Boolean! 

    # Brand ID.
    brandId:  String 

    # Files associated with the payload.asset.
    files:  JSONObject! 

    # Copyright of the payload.asset.
    copyright:  String 

    # Extensions of the asset file. This can have more than one value in case of a
    # derivative with different extensions.
    extensions: [String!]! 

    # Whether or not this asset is marked as Limited Use.
    #
    # Knowledge base entry
    isLimitedUse:  Boolean! 

    # Whether or not this asset is marked as Public.
    #
    # Knowledge base entry
    isPublic:  Boolean! 

    # Whether or not this asset has a watermark.
    #
    # Knowledge base entry
    isWatermarked:  Boolean! 

    # Tags of the payload.asset.
    #
    # Knowledge base entry
    tags: [String!]! 

    # Asset original URL.
    originalUrl:  URI 

    # Metaproperties of the asset
    #
    # Knowledge base entry
    metaproperties:  MetapropertyConnection! 

    # Metaproperties of the asset with type `text` and `longtext`
    #
    # Knowledge base entry
    textMetaproperties: [TextMetaproperty!]! 
}


type TextMetaproperty {
    name:  String!
    value:  String!
}


type MetapropertyConnection {
    nodes: [Metaproperty!]!
}


type Metaproperty {
    id:  ID!
    name:  String!

    # Arguments
    # language: Preferred language for this label
    label(language:  String):  String!

    type:  String!

    zIndex:  Int!

    options: [ MetapropertyOption!]!

    isApiField:  Boolean!

    isEditable:  Boolean!

    isFilterable:  Boolean!

    isMainfilter:  Boolean!

    isMultifilter:  Boolean!

    isMultiselect:  Boolean!

    isRequired:  Boolean!

    isSearchable:  Boolean!
}


type MetapropertyOption {

    id:  ID!

    name:  String!

    assetCount:  Int!

    # Arguments
    # language: Preferred language for this label
    label(language:  String):  String!

    displayLabel:  String!

    imageUrl:  URI

    zIndex:  Int!

    isActive:  Boolean!

    isHiddenByDefault:  Boolean!

    isSelectable:  Boolean!
}

type AdditionalInfo {
  selectedFile?: {
    url: string
    width?: number
    height?: number
    fileSize?: number
  }
}

Type definitions

AssetType

type AssetType = 'AUDIO' | 'DOCUMENT' | 'IMAGE' | 'VIDEO'

AssetFilterJson & Other Configurations

type AdditionalInfo = { selectedFile?: File }

type File = { url: string; width?: number; height?: number; fileSize?: number; }

type MetapropertyName = string;
type MetapropertyOptionName = string;
type MetapropertyOptionId = string;

type PredefinedMetapropertiesOptionsType = {
        MetapropertyName: { MetapropertyOptionName: MetapropertyOptionId }
    }

type AssetFilterJson = {
    predefinedAssetType?: AssetType[]; //predefined asset types
    collectionId?: string; //predefined collection id. Predefined collection ID should be provided in base64Encoded format (Collection_id 737141DC-7562-49C4-8BD8F6628578028A)
    predefinedMetapropertiesOptions?: PredefinedMetapropertiesOptionsType; //predefined metaproperty IDs
    searchTerm?: string; //predefined search term
    predefinedTagNames?: string[]; //predefined tags
    isLimitedUse?: boolean; //whether or not this asset is marked as Limited Use
    showToolbar?: boolean; //show toolbar for predefined filters (false by default)
};
}

Collection IDs must be base64-encoded. Example: Collection_id 737141DC-7562-49C4-8BD8F6628578028A encodes to KENvbGxlY3Rpb25faWQgNzM3MTQxREMtNzU2Mi00OUM0LThCRDhGNjYyODU3ODAyOEEp.

Theme

type Theme = {
  colorPrimary?: CSSColor
  colorButtonPrimary?: CSSColor
  colorButtonPrimaryLabel?: CSSColor
  colorButtonPrimaryActive?: CSSColor
  colorButtonPrimaryHover?: CSSColor
  colorButtonPrimaryHoverLabel?: CSSColor
}

Container mode{#container-mode}

Pass a DOM element as container to mount UCV inside your page instead of a modal:

BynderCompactView.Open({
  container: document.getElementById('my-ucv-container'),
  onSuccess: function(assets) { /* ... */ }
});

Important: the container element must use height (not max-height) for UCV to correctly calculate its own height. Using max-height will break the layout.

Use resetStoreOnMount: true to reset internal state each time the component mounts in container mode.

Limitations

  • 3D assets are not supported in UCV.
  • Container mode height: the container element must use the height CSS property, not max-height. UCV cannot determine its own height when max-height is set.

Migration from 1.x.x

From Universal Compact View 2 and onwards a JavaScript API allowing programmatic control of the component lifetime is used. The most notable change when migrating is the switch away from configuration using HTML data attributes.

Migration from 2.x.x

The only breaking change lies in the npm package (link above), and only within the @bynder/compact-view/components part of the package. If using the Cloudfront url it is safe to skip this part.

As we introduced the Bynder design system in UCV, some of the components exposed in @bynder/compact-view/components have been replaced with the design system variant as well. Action needs to be taken if you are using the Checkbox, Button and/or Card* component(s)

Migration to 5.x

Introduced a new filter system, applying similar filters to the Assets portal.

Breaking change is assetFilter, which provides new names:

{
  assetType_in? -> predefinedAssetType: AssetType[]; //predefined asset types
  collectionId?: string; //predefined collection id
  metapropertyOptionId_in? -> predefinedMetapropertiesOptions: predefinedMetapropertiesOptions type; //predefined metaproperty IDs
  searchTerm?: string; //predefined search term
  tagNames_in? -> predefinedTagNames: string[]; //predefined tags
  isLimitedUse?: boolean; //whether or not this asset is marked as Limited Use
  showToolbar?: boolean; //show toolbar for predefined filters (false by default)
}
Example for predefinedMetapropertiesOptions 
predefinedMetapropertiesOptions: {
    metapropertyName: {
        optionName1: "optionId1",
        optionName2: "optionId2"
    }
}

the @bynder/compact-view/components package is removed

Change URL of CDN script: Source: https://ucv.bynder.com/5.0.5/modules/compactview/bynder-compactview-5-latest.js

Sources

URLs below will always serve latest version of the major release:
Version 5: https://ucv.bynder.com/5.0.5/modules/compactview/bynder-compactview-5-latest.js
Version 6: https://ucv.bynder.com/5.0.5/modules/compactview/bynder-compactview-6-latest.js (Latest Release)

Version History

Current release: 6.1.0

VersionHighlights
6.1.0Bug fixes.
Performance improvements and fixes for smartfilter loading
6.0.2Bug fixes.
Fixed a limit that prevented selecting or rehydrating more than 50 assets
6.0.1Bug Fixes
6.0.0New Cloudfront Distribution. This will always serve the latest version for major release 6. Previous links will continue to function, but will not have new features released in version 6+.
CDN script Source: https://ucv.bynder.com/5.0.5/modules/compactview/bynder-compactview-6-latest
Added React 19 support (peer dependency now react/react-dom ^19.2.5)
Added an onClose callback — fires on backdrop click, Escape, or the close button
New option enableDATPermissionManagement - control access to DAT Transform UI
Public Video derivatives now show in derivative selection menu in SingleSelectFile mode
DAT Preset Folder organization in derivative selection menu in SingleSelectFile mode
Performance, bug, and security fixes
5.4.0New option isPersonal - filters asset request to show only personal assets
DASH link is no longer shown by default in adaptive video streaming selector
New option enableDASH - enable DASH option in AVS
New option embedType - predefine response for AVS embed code.
Script option returns the embed code as HTML script tag. iframe option returns the embed code, wrapped in iFrame HTML tag. Default to script.
New option resetStoreOnMount - reset the store on mount for UCV in container mode
Fixed typing for onSuccess callback
Performance improvements and fixes
5.3.0Added an option to select embeddable code in adaptive video links
Performance improvements and fixes
5.2.4Performance improvements and bug fixes
5.2.3Performance improvements and bug fixes
5.2.2Performance improvements and bug fixes
5.2.1Performance improvements and bug fixes
5.2.0Users can view Limited Usage Assets
Custom Default Derivative Selection: defaultImageDerivativeName and defaultVideoDerivativeName props
Improved Loading Speed for Smart Filters
5.1.4New JS Bundler, Various bug fixes
5.1.3Performance improvements and fixes
5.1.2Video assets now have access to Adaptive video streaming links in derivative dropdown
Metaproperty filters have drag-to-scroll functionality
Performance improvements and fixes
5.1.1Performance improvements and fixes
5.1.0Introducing Bynder's AI search abilities in UCV, including Similarity search and Natural language search
5.0.0New version of smartfilters with Autocomplete metaproperty available
Breaking changes:
assetFilter signature
Change URL of CDN script: https://ucv.bynder.com/5.0.5/modules/compactview/bynder-compactview-5-latest.js
4.3.2Performance improvements and fixes
4.3.1Performance improvements and fixes
4.3.0Added optional prop selectAllOption for selecting all assets if MultiSelect mode enabled
4.2.3Added optional prop hideSwitch for disabling frontend cache
4.2.2Date metaproperties are shown in UTC format
4.2.1Metaproperties are now sorted on the Asset card based on the sortOrder chosen within the DAM
4.2.0Added optional prop hideSwitch for hiding switch between Assets and Collections
4.1.0Added Toolbar for single Collection view
4.0.1Performance improvements and fixes
4.0.0React version is upgraded to React 18
Displayed on Asset Card metaproperty value is limited to 100 chars. Full value is shown on hover
3.4.1Performance improvements and fixes
3.4.0DAT-UI updated to the latest version. Added new transformations
Added a property for option assetFilter showToolbar. If passed true - Toolbar is shown when asset filters are predefined
Added extensions for selected files in MultiSelect mode
Additional info for the selected file will be shown for multiple onSuccess callback calls in container mode
Resolved conflict between UCV's Sentry and parent's app Sentry
3.3.4Fixed formatting for TextMetaproperties
3.3.3TextMetaproperties are now shown on the asset card
Fixed breaking error when global variable process does not have env property
3.3.2Added optional prop onLogout for passing callback, which will be called after logout
3.3.1Performance improvements and fixes
3.3.0Added option for custom styling modal window modalStyles
Fixed width in container mode
Improvements for example app
3.2.4Added additional filters for example applications
Performance improvements and fixes
3.2.3Added extensions param to default getAssets query
Remove tooltips on title at hover
Added expanding hover to long asset name
Fixed login window position in container view option
Prevent flickering at first loading in Firefox
Added the DAT-UI for WebDAM
3.2.2Fixed an issue with the scrollbar
3.2.1Fixed an issue with the filters where these could end up outside of the container
3.2.0The DAT-UI is now available within the UCV (requires DAT on account and SingleSelectFile mode)
Performance improvements and fixes
3.1.3Performance improvements and fixes
3.1.2Performance improvements and fixes
3.1.1Webdam filter support (Search Facets)
Webdam XMP Metadata marked as required is now shown on the Asset Card
Performance improvements and fixes
3.1.0Limited assets are now displayed in UCV
Option to hide limited assets for all users is added
Performance improvements and fixes
3.0.0Access token can now be provided via configuration
Components replaced with Bynder design system version for a more consistent user experience
General performance improvements and fixes
2.6.1selectedAssets are now returned in the same order as listed in configuration
Accessibility is improved by enabling keyboard users to select assets
2.6.0Metaproperties with the showInListView or showInGridView option enabled will now display in the asset overview
2.5.0Compact View can now connect and load to WebDAM portals (now referred to as Universal Compact View)
General performance improvements and fixes
2.4.3General performance improvements and fixes
2.4.2General performance improvements and fixes
2.4.1Support for digital asset transformation (DAT)
General performance improvements and fixes
2.4.0Assets can be preselected when opening Compact View
Several security updates
General performance improvements and fixes
2.3.0General performance improvements and fixes
2.2.1General performance improvements and fixes
2.1.0New OAuth 2 support
Display watermarked status for assets
Derivative selection is now available
New read-only portal configuration
Asset status (archived, watermarked, etc.) improvements
General performance improvements and fixes
2.0.0General performance improvements and fixes
New login page implemented
New Compact View API
1.5.0New attribute data-shadowDom for toggling the usage of shadow DOM
New attribute data-modal for displaying the Compact View in a modal
1.4.0Added close button when autoload is not enabled
Improved authorisation error handling
Improved performance for large asset banks
Decreased bundle size by ~200kB
1.3.0New attribute data-searchTerm for setting the initial search value
1.2.0New look and feel to match Flagship experience
Added document and audio support
Added Smart Filter support
Added Advanced Filter
Added ability to open asset detail screen in new tab
Front end written completely in ReasonML
Back end written completely in OCaml
1.1.0Added video support
Added support for Safari and IE11
Configurable as multi select or single select

See it in action

Try the live demo to explore configuration options and see the component running against a real Bynder portal.