Avatars

The agnostic-astro package utilizes XElement under-the-hood in order to provide build-time Astro components. These build-time components will help your project get closer to realizing a mostly no client-side runtime…if you do it right, this should mean an all-green 100% Lighthouse performance score! Leverage the benefits of Islands architecture by sending mostly server built agnostic-astro components. Then, sprinkle client-hydrated ones only as needed.

Usage

Ensure you've installed the agnostic-astro npm package (note this installs depedency agnostic-css as well):

npm i agnostic-astro

and then import common.min.css from your “base layout” (you should only need to do this in once place as this is global CSS). This brings in the required CSS custom properties, reset, and properties:

import 'agnostic-css/public/css-dist/common.min.css';

Then you can import Astro Avatar component:

import AgAvatar from 'agnostic-astro/Avatar.astro';

Here's the agnostic-astro Alert component in use:

<Avatar text="AB" />
<AgAvatar text="ab" type="success" />
<AgAvatar text="ab" type="warning" />
<AgAvatar text="ab" type="error" />
<AgAvatar text="ab" type="info" />
<AgAvatar type="success" imgUrl="https://joeschmoe.io/api/v1/jess" />
<AgAvatar text="sm" size="small" />
<AgAvatar text="def" />
<AgAvatar text="lg" size="large" />
<AgAvatar text="xl" size="xlarge" />
<div class="avatar-group">
  <AgAvatar imgUrl="https://joeschmoe.io/api/v1/julie" />
  <AgAvatar imgUrl="https://joeschmoe.io/api/v1/jess" />
  <AgAvatar imgUrl="https://joeschmoe.io/api/v1/jon" />
  <AgAvatar imgUrl="https://joeschmoe.io/api/v1/jia" />
  <AgAvatar imgUrl="https://joeschmoe.io/api/v1/joe" />
</div>
Sizes
Grouped