BBC's guide to development
  • General

    • About
    • Tools
    • Git(hub)
    • Showpad
    • Hosting
    • Maintenance
    • Security
    • Go live checklist
  • Front-end development

    • Bundlers
    • CSS/SCSS
    • Javascript
    • Vue
    • PHP
    • Mails
    • Dev Faq
  • Functions
  • Mixins
  • General

    • OOP Structure
  • Component Classes

    • Accordion
    • App
    • Component
    • HighwayApp
    • Popup
    • PNG Sequencer
    • Tab
  • Manager Classes

    • BountListenerMgr
    • Cache
    • Configuration
    • InViewStateMgr
    • Instance Manager
    • Event dispatcher
  • Factories

    • SwiperFactory
  • PDF

    • AssetLoader
    • BasePdfDoc
    • TemplatePdfDoc
    • CustomPdfDoc
  • Utility functions

    • canvas
    • Connection Status
    • css
    • dev
    • placeholder
    • dom
    • fetch
    • json
    • object
    • scroll
    • scrollbar
    • spreadsheets
    • string
    • url
  • General

    • ComponentMgr
    • ThreeJsViewer
  • Components

    • ComponentMgr
    • GltfModel
    • Snappable
    • Socket
    • ThreeJsViewer
    • ThreeJsViewerCamera
  • Loaders

    • ConfigurationSerializer
    • GltfBlockParser
  • Utils

    • CanvasInputAdapter
    • CollisionManager
    • SocketGridExpander
    • blender
    • headless
  • General

    • Troubleshooting
    • Legacy
  • Components

    • AssetBar
    • ConfigGenerator
    • ShowpadApp
  • Managers

    • Assets
    • AppsDb
    • Config
  • Utils

    • Connection Status
    • general
    • showpad-interactive
    • showpad-upload
  • Components

    • Accordion
    • BackButton
    • Breadcrumb
    • ByltButton
    • Hamburger
    • Icon
    • Logo
    • Loader
    • Modal
    • Popup
    • Prompt
    • ProgressBar
    • TextLoader
  • Composables

    • useDebugMode
    • useConnectionStatus
  • Utils

    • dom
    • props
  • General

    • General
    • Tracking
  • Components

    • Accordion
    • ActionButton
    • AssetItem
    • AssetList
    • BackButton
    • ConfigGenButton
    • Logo
    • Media
    • Modal
    • Popup
    • Prompt
    • SPButton
    • SPRouterView
    • SPTrackedRouterLink
    • TextLoader
    • View
  • Composables

    • useConnectionStatus
  • Stores

    • useAppsDbStore
    • useBreadcrumbStore
    • useShowpadAPIStore
    • useShowpadSDKStore
    • useSpConfigStore
    • useSpStore
    • useSpTrackingStore
  • The New Kit

    • General
    • Installation & Usage
    • ACF Blocks
    • PHPCS
    • Functions
    • Vite
    • WP Config
    • Staging Deployment
  • Best Practices

    • Page Structure
    • Fonts/Typography
  • Todo
GitHub
  • General

    • About
    • Tools
    • Git(hub)
    • Showpad
    • Hosting
    • Maintenance
    • Security
    • Go live checklist
  • Front-end development

    • Bundlers
    • CSS/SCSS
    • Javascript
    • Vue
    • PHP
    • Mails
    • Dev Faq
  • Functions
  • Mixins
  • General

    • OOP Structure
  • Component Classes

    • Accordion
    • App
    • Component
    • HighwayApp
    • Popup
    • PNG Sequencer
    • Tab
  • Manager Classes

    • BountListenerMgr
    • Cache
    • Configuration
    • InViewStateMgr
    • Instance Manager
    • Event dispatcher
  • Factories

    • SwiperFactory
  • PDF

    • AssetLoader
    • BasePdfDoc
    • TemplatePdfDoc
    • CustomPdfDoc
  • Utility functions

    • canvas
    • Connection Status
    • css
    • dev
    • placeholder
    • dom
    • fetch
    • json
    • object
    • scroll
    • scrollbar
    • spreadsheets
    • string
    • url
  • General

    • ComponentMgr
    • ThreeJsViewer
  • Components

    • ComponentMgr
    • GltfModel
    • Snappable
    • Socket
    • ThreeJsViewer
    • ThreeJsViewerCamera
  • Loaders

    • ConfigurationSerializer
    • GltfBlockParser
  • Utils

    • CanvasInputAdapter
    • CollisionManager
    • SocketGridExpander
    • blender
    • headless
  • General

    • Troubleshooting
    • Legacy
  • Components

    • AssetBar
    • ConfigGenerator
    • ShowpadApp
  • Managers

    • Assets
    • AppsDb
    • Config
  • Utils

    • Connection Status
    • general
    • showpad-interactive
    • showpad-upload
  • Components

    • Accordion
    • BackButton
    • Breadcrumb
    • ByltButton
    • Hamburger
    • Icon
    • Logo
    • Loader
    • Modal
    • Popup
    • Prompt
    • ProgressBar
    • TextLoader
  • Composables

    • useDebugMode
    • useConnectionStatus
  • Utils

    • dom
    • props
  • General

    • General
    • Tracking
  • Components

    • Accordion
    • ActionButton
    • AssetItem
    • AssetList
    • BackButton
    • ConfigGenButton
    • Logo
    • Media
    • Modal
    • Popup
    • Prompt
    • SPButton
    • SPRouterView
    • SPTrackedRouterLink
    • TextLoader
    • View
  • Composables

    • useConnectionStatus
  • Stores

    • useAppsDbStore
    • useBreadcrumbStore
    • useShowpadAPIStore
    • useShowpadSDKStore
    • useSpConfigStore
    • useSpStore
    • useSpTrackingStore
  • The New Kit

    • General
    • Installation & Usage
    • ACF Blocks
    • PHPCS
    • Functions
    • Vite
    • WP Config
    • Staging Deployment
  • Best Practices

    • Page Structure
    • Fonts/Typography
  • Todo
GitHub
  • AssetList

AssetList

import { AssetList } from '@bbc/front-end-kit/vue/showpad'

The AssetList component renders a list of Showpad asset objects using a Vue component for each item.

Getting Started

There are two ways to use the AssetList component:

<template>
    <!-- Using an array of assets directly -->
    <AssetList :Item="AssetItem" :assets="showpadAssetList" />

    <!-- Using data-sp for asset injection from the Showpad config -->
    <AssetList :Item="AssetItem" data-sp="path.to.asset-grid" />
</template>

<script setup>
import { AssetList, AssetItem } from '@bbc/front-end-kit/vue/showpad'
</script>

Precedence

When assets is provided it is used directly and the data-sp config path is ignored. The config path is only read when assets is null.

Generated Config Example

When using data-sp with the default dataSpAsset="tags", the following configuration structure is generated:

{
    "content": {
        "path": {
            "to": {
                "asset-grid": {
                    "assets": {
                        "tags": {
                            "type": "tags",
                            "value": null,
                            "description": "Asset Grid"
                        },
                        "page-tags": {
                            "type": "page-tags",
                            "value": null,
                            "description": "Asset Grid"
                        }
                    }
                }
            }
        }
    },
    "labels": {
        "path": {
            "to": {
                "asset-grid": {
                    "empty": {
                        "value": "No assets found",
                        "description": "Message displayed when no assets are available."
                    }
                }
            }
        }
    }
}

API

data-sp-*

The hidden config span uses data-sp, data-sp-asset, and data-sp-description to drive asset injection from the Showpad config when assets is not provided.

Properties

Item

The Vue component used to render each asset in the list.

Values: Vue Component

Required: yes

assets

An array of asset objects to render. When provided, takes precedence over the data-sp config path.

Values: Array of Showpad asset

Default: null

itemProps

Additional props forwarded to each rendered Item component via v-bind.

Values: Object

Default: {}

emptyMessage

The message displayed when no assets are available.

Values: String

Default: 'No assets found'

showEmptyMessage

Whether to show the empty message when no assets are available.

Values: Boolean

Default: true

Tips

Set this to false when empty lists should be hidden — this also suppresses generation of the empty message field in the config.

dataSp

The data-sp path used for config-driven asset injection. Only active when assets is null.

Values: String

Default: ''

dataSpAsset

Controls which config key type is used to fetch assets. 'tags' reads from [path].assets.tags and [path].assets.page-tags. Any other value reads from [path].assets directly.

Values: String

Default: 'tags'

dataSpDescription

Description applied to the hidden config span via data-sp-description.

Values: String

Default: 'Asset Grid'

Slots

default

Customizes the contents of each rendered item. Passed through to the Item component.

Properties
  • asset: The Showpad asset object for that item.
Edit this page
Last Updated: 4/27/26, 12:56 PM
Contributors: Nicolas Jaenen