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 Tabs component (agnostic-astro
ships with the astro-agnosticui
integration):
import AgTabs from '../../lib/components/Tabs.astro';
import AgTabPanel from '../../lib/components/TabPanel.astro';
import AgTabButton from '../../lib/components/TabButton.astro';
Here's the agnostic-astro Tabs component in use:
<tbd>tbd—coming soon ;-)</tbd>
Tab 1 content (no padding or margins so consumer can control desired gutters). Here's an yahoo link, and a github link to test keybaord navigation.
Tab 2 content (no padding or margins so consumer can control desired gutters)
Tab 3 content
Tab 4 content
Tab 1 content (no padding or margins so consumer can control desired gutters). Here's an yahoo link, and a github link to test keybaord navigation.
Tab 2 content (no padding or margins so consumer can control desired gutters)
Tab 3 content
Tab 4 content
Panel content
Panel 1
Panel 2
Panel 3
Panel 4
Svelte Tab (1) content (no padding or margins so consumer can control desired gutters). Here's an
yahoo link, and a github link to
test keybaord navigation. You can use TAB
to tab into the panel. You can use arrow keys to navigate
the tab buttons themselves. Try tab and shift-tab.
React Tab (2) content (no padding or margins so consumer can control desired gutters)
Vue Tab (3) content