Creating Link Previews With the Firefly Semantics fs-link-preview Web Component | Task

Ole Ersoy
Apr - 22  -  1 min

Scenario

We want create a link preview with a:

  • title
  • description
  • image
  • domain
  • url

This is an example:

Approach

Include fs-link-preview via CDN like this in your html page:

<script src="https://unpkg.com/@fireflysemantics/fs-link-preview"></script>

Then markup the element as is illustrated in this example:

<fs-link-preview 

    imageURL="https://raw.githubusercontent.com/fireflysemantics/slice/master/logo/slicelogo.png"
        
    title="@fireflysemantics/slice" 
    
    description="Lightweight Reactive Web Application State Management"
        
    domain="www.npmjs.com" 
    
    url="https://www.npmjs.com/package/@fireflysemantics/slice">
</fs-link-preview>

Demo