Tabs

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 Tabs component:

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>
Note that no padding or margins are added to the tab panels so consumer can have full control of panel gutters
Default Tabs

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.

Vertical Orientation

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.

Disabled

Panel content

Disabled Options

Panel 1

Custom Tab Buttons

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.