glorpies

astro

The element in .astro files, or a component in an island.

❯npm i glorpies

in an astro component

Astro passes custom elements through untouched. Register the element from a <script>, which Astro bundles for the client:

UserBadge.astro
---const { email } = Astro.props;--- <glorpie-face name={email} size="40" style="width: 40px; height: 40px"></glorpie-face> <script>  import 'glorpies/element';</script>
ada@lovelace.dev
agent-47
grace@hopper.dev

Every option is an attribute. The inline size reserves the space until the element upgrades.

in a framework island

If you already use React, Vue, Svelte, Solid or Preact in Astro, use that component as an island. It server-renders a placeholder, and with client:visible it hydrates only when scrolled into view:

Team.astro
---import { Glorpie } from 'glorpies/react';--- <Glorpie client:visible name="ada@lovelace.dev" size={40} />

as an image

For zero client JavaScript, serve faces from an image route and use an <img>.