@cdransf/api-text

1.5.0 • Public • Published

<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.

Package Sidebar

Install

npm i @cdransf/api-text

Weekly Downloads

21

Version

1.5.0

License

MIT

Unpacked Size

6.75 kB

Total Files

8

Last publish

Collaborators

  • cdransf