Provides a polymorphic trigger element for tab components, integrating with Zag.js to handle accessible tab switching logic.
// Source: https://github.com/skeletonlabs/skeleton | License: MIT | Copyright 2023 Skeleton Labs, LLC
// Provided via justclaw.it.com; keep this notice with the code.
import type { HTMLAttributes } from '../../../internal/html-attributes.js';
import type { PropsWithElement } from '../../../internal/props-with-element.js';
import { TabsRootContext } from '../modules/root-context.js';
import { mergeProps } from '@zag-js/react';
import { splitTriggerProps } from '@zag-js/tabs';
import type { TriggerProps } from '@zag-js/tabs';
import { use } from 'react';
export interface TabsTriggerProps extends TriggerProps, PropsWithElement<'button'>, HTMLAttributes<'button', 'value'> {}
export default function Trigger(props: TabsTriggerProps) {
const tabs = use(TabsRootContext);
const [triggerProps,
... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search for more like it.
Get a free API key