Styleguide Navigation

Share Price

Updates

  • 2018-07-18 Added data-js-shareprice attribute for dynamic display (markup) [pul]
  • 2018-07-18 Changed time tag to p and removed datetime attribute (markup) [pul]
  • 2018-08-03 Share Price with chart. (markup) [jch]
  • 2018-11-14 SRWFE-711 A11Y 14: SharePrice--value and SharePrice--change tags changed to p (markup) [pul]
  • 2018-11-26 SRWFE-790: Added examples with link (markup) [pul]
  • 2019-08-07 SRWFE-1174: Updated Shareprice default URL (markup) [pul]
  • 2020-05-11 SRWFE-1650: Load Shareprice timezone from API - add span.SharePrice--timeZone wrapper (markup) [pul]
  • 2020-12-15 SRWFE-2036: Variants with chart removed, variants with p.SharePrice--text added. (markup) [ari]
  • 2021-02-09 SRWFE-2181: Updated default URL. (example) [pul]

Script Options

You can change the following options to configure the SharePrice script (by passing them in data-js-shareprice):

  • src: The src of the share price data (needs to be JSON!). Defaults to the URL for production (https://shareprice.www.swissre.com/Clients/ch/swissre/xml/xml.aspx?format=json).
  • priceData: An object of keys that you want to get from the source and selector strings for the fields tht should be replaces as values. For example: Currency: '.SharePrice--currency'

You can also leave out the [data-js-shareprice] attribute if you want to have a static display: