Ox Content

tabs.ts

Source

resetTabGroupCounter

function

Reset tab group counter (for testing).

Source

export function resetTabGroupCounter(): void

Returns

void -


getAttribute

function

Get element attribute value.

Source

function getAttribute(el: Element, name: string): string | undefined

Returns

string | undefined -


parseTabChildren

function

Parse Tab elements from Tabs children.

Source

function parseTabChildren(children: Element["children"]): TabData[]

Returns

TabData[] -


createTabsElement

function

Create the HTML structure for tabs.

Source

function createTabsElement(tabs: TabData[], groupId: string): Element

Returns

Element -


createFallbackElement

function

Create fallback HTML using <details> elements.

Source

function createFallbackElement(tabs: TabData[]): Element

Returns

Element -


rehypeTabs

function

Rehype plugin to transform Tabs components.

Source

function rehypeTabs()

transformTabs

function

Transform Tabs components in HTML.

Source

export async function transformTabs(html: string): Promise<string>

Returns

Promise<string> -


generateTabsCSS

function

Generate dynamic CSS for :has() based tab switching. This is needed because :has() selectors need unique IDs.

Source

export function generateTabsCSS(groupCount: number): string

Returns

string -