@smartcompanion/ui
v1.0.0
Published
Stencil web components for SmartCompanion audio-guide apps — station lists, player controls, maps and more.
Maintainers
Readme
@smartcompanion/ui
The web components behind the SmartCompanion audio-guide apps — built with Stencil, so they work in any framework or none. Five building-block components and thirteen ready-made pages, from the station list to the map.
Part of the SmartCompanion Library monorepo.
Browse the components in Storybook →
Install
npm install @smartcompanion/uiRequires Node 20 or newer, and @smartcompanion/data >=0.9.0 as a peer. Pages are driven by a ServiceFacade from @smartcompanion/services.
Usage
Importing the package registers every custom element:
import '@smartcompanion/ui';Pages take the service facade as a prop:
<sc-page-stations facade={serviceFacade} />In a Stencil app that is typically passed via componentProps on the router route. defineCustomElements is also available from @smartcompanion/ui/loader if you need to control registration yourself.
Components
Building blocks:
sc-image-slideshow · sc-marquee · sc-numpad · sc-player-controls · sc-station-icon
Pages:
sc-page-error · sc-page-language · sc-page-loading · sc-page-map · sc-page-multi-audio-station · sc-page-pin · sc-page-selection · sc-page-station · sc-page-station-image-list · sc-page-station-list · sc-page-stations · sc-page-tabbed-station-list · sc-page-tour-list
Props and events for each are documented in Storybook.
Maps
sc-page-map renders with MapLibre GL. Give it either mapStyleUrl for vector tiles or tileUrlTemplate for a raster {z}/{y}/{x} template — exactly one of the two is required.
License
BSD-2-Clause. See LICENSE.
