Skip to content

cdransf/api-text

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

<api-text> web component

A web component to load text from an API and display it.

npm i @cdransf/api-text

Example usage

Add the api-text.js to your markup and define the necessary markup within your web component:

<script type="module" src="api-text.js"></script>
<api-text api-url="/api/now-playing">
  <p class="loading">🎧 Loading...</p>
  <p class="content"></p>
</api-text>

I use this component to load media data from a Netlify edge function and describe an earlier iteration in this blog post.