SLB: Notes – JS: Components

By Sol in Lab


  1. Global properties support
  2. Manage instances of components that can have multiple configurations
    • e.g. viewers, groups, etc.
  3. Component instances member of container/controller object

Global Properties/Methods

Properties/Methods used by all components, etc.

  • Default configuration (for component instances, etc.)
  • Aggregate component instances
  • Initialize/Add new component instances

Component Instances

  • Instances grouped by component and stored in controller object (in array or object)
  • Each component instance can have a different configuration
  • Reference controller object (e.g. SLB.View)
    • Provides access to controller props/methods

Component Types


Basic component that all other components are based on.

Note: This is an internal type and no instances are directly initialized/used


  • attributes (object): Component attributes


Content viewer (aka: the lightbox).  Manages options for displaying the themes and content.


  • theme (Theme): Unique instance, child of predefined theme (labels, options, etc. may different from other viewers using same theme)
  • item (Content_Item): Current item loaded in Viewer
  • group (Group): Current group loaded in Viewer


  • labels (object): UI Text


Collection of Content Items


  • items (array[Content_Item]): Content items in group
    • Cached: Fetched from DOM initially
  • viewer (Viewer): options for displaying items group

Content Type

Supported content type with instructions on how to display content in Viewer


  • item (Content_Item): For access to current item data while evaluating/rendering
    • Cached: Fetched from DOM initially


  • template (string): HTML markup template for displaying content type

Content Item

Content to display in Viewer


  • group (group): Group item belongs to
    • Cached: Fetched from DOM initially
  • viewer (Viewer): options for displaying item
  • content_type (Content_Type): Handles display of item’s type


  • uri (string): Item URI
  • attributes (object): Type-specific attributes (width, height, src, etc.) to be accessed by respective Content Type


HTML layout/CSS used by Viewers


  • viewer (Viewer): Access to viewer options at runtime
  • item (Content_Item): Access to item data at runtime
    • Also provides access to Group data


  • template (string): Raw HTML layout (with data placeholders, etc.)
  • container (DOM element): DOM element containing theme output
    • For reusing DOM elements built for theme