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.
Ensure you've installed and setup the AgnosticUI Astro integration
which will import the required common.min.css
onto your page:
npm i astro-agnosticui
Then add the integration to your astro.config.mjs
(you may need to run Astro with experimental integrations flag astro dev --experimental-integrations
):
import { defineConfig } from 'astro/config';
import agnosticAstro from 'astro-agnosticui';;
export default defineConfig({
integrations: [agnosticAstro()]
});
Then you can import Astro Alert component (agnostic-astro
ships with the astro-agnosticui
integration):
import AgAlert from 'agnostic-astro/Alert.astro';
Here's the agnostic-astro Alert component in use:
<AgAlert><p>{copy}</p></AgAlert>
<AgAlert isBorderAll><p>{copy}</p></AgAlert>
<AgAlert isBorderLeft><p>{copy}</p></AgAlert>
<AgAlert isBorderTop><p>{copy}</p></AgAlert>
<AgAlert isBorderBottom><p>{copy}</p></AgAlert>
<AgAlert isBorderRight><p>{copy}</p></AgAlert>
<AgAlert type="dark"><p>{copy}</p></AgAlert>
<AgAlert type="success"><p>{copy}</p></AgAlert>
<AgAlert type="info"><p>{copy}</p></AgAlert>
<AgAlert type="warning"><p>{copy}</p></AgAlert>
<AgAlert type="error"><p>{copy}</p></AgAlert>
<AgAlert isIcon type="dark"><p>{copy}</p></AgAlert>
<AgAlert isIcon type="success"><p>{copy}</p></AgAlert>
<AgAlert isIcon type="info"><p>{copy}</p></AgAlert>
<AgAlert isIcon type="warning"><p>{copy}</p></AgAlert>
<AgAlert isIcon type="error"><p>{copy}</p></AgAlert>
Alert messages should be timely and concise.
Alert messages should be timely and concise.
Alert messages should be timely and concise.
Alert messages should be timely and concise.
Alert messages should be timely and concise.
Alert messages should be timely and concise.
Alert messages should be timely and concise.
Alert messages should be timely and concise.
Alert messages should be timely and concise.
Alert messages should be timely and concise.
Alert messages should be timely and concise.
Alert messages should be timely and concise.
Alert messages should be timely and concise.
Alert messages should be timely and concise.
Alert messages should be timely and concise.
Alert messages should be timely and concise.