import React, { type ReactNode } from 'react'; import type { IconOrContent, RenderProps } from '../../util/utility-types'; import type { Align } from '../../util/variant-types'; export type TabGroupProps = { /** * Reference to another element that describes the purpose of the set of tabs. */ 'aria-labelledby'?: string; /** * Calls back with the active index */ onChange?: (index: number) => void; /** * Child node(s) that can be nested inside component */ children?: ReactNode; /** * CSS class names that can be appended to the component. */ className?: string; /** * HTML id for the component */ id?: string; /** * Passed down to initially set the activeIndex state */ activeIndex?: number; /** * Alignment of the tabs, when there is additional space available (not full width) */ align?: Align; /** * Whether the divider line (separating tabs from content) is visible. * * **Default is `"true"`**. */ hasDivider?: boolean; /** * */ isSticky?: boolean; /** * Control how the indidivual tabs take up the available space. * * **Default is `"auto"`**. */ tabWidth?: 'auto' | 'full'; /** * Controls whether we are using the default or inverted pallet for this component * * **Default is `"default"`**. */ variant?: 'default' | 'inverse'; }; export type TabProps = { /** * aria-labelledby attribute that associates a tab panel with its accompanying tab title */ 'aria-labelledby'?: string; /** * Child node(s) that can be nested inside component */ children?: ReactNode; /** * CSS class names that can be appended to the component. */ className?: string; /** * HTML id for the component */ id?: string; /** * Number passed down from Tabs to show the active index state of Tabs */ activeIndex?: number; /** * Text used to label the tab in the tab list */ title: string; /** * Leading slot for the tab. Takes an EDS icon name, or any content to render in its * place at 16px. */ icon?: IconOrContent; }; type TabButtonProps = RenderProps; export type TabContextArgs = { isActive: boolean; title: string; }; /** * ## Usage * * | Type/Use | Description | Example | * |----------|-------------|---------| * | Standard horizontal | A row of clickable labels that switch content panels below. | Settings pages, user profiles, simple content sections. | * | Scrollable | Tabs that scroll horizontally if there are too many to fit. | Mobile views, multi-section tools. | * | Disabled states | Tabs may be inactive or unavailable depending on state or permissions. | Conditional access, incomplete onboarding steps. | * | Dynamic | Tabs added or removed based on user input or system state. | Custom workflows, data-driven interfaces. | * * The minimum number of tabs is 2, with no maximum, but use caution beyond 6 tabs as content can become buried. * * ## Interaction * * When there are too many tabs to fit, the tab group scrolls horizontally and shows a scrolling gradient at the edges. A divider can visually separate the tab group from the content it controls; if a tab group is sticky on scroll (`isSticky`), it must have a divider (`hasDivider`) to maintain visual separation as content moves underneath it. * * ## Content & Accessibility * * ### Do's * * * Order tabs by priority or importance from left to right. * * Ensure labels clearly communicate the contents of the tab. * * Limit labels to 1 or 2 words. * * Use sentence case for each label. * * ### Don'ts * * * Don't repeat page-level information as part of the label (e.g. use "All" rather than "All groups"). * * Don't truncate tab labels; consider alternative labels before settling for truncation. */ export declare const TabGroup: { ({ activeIndex, align, "aria-labelledby": ariaLabelledBy, children, className, hasDivider, isSticky, onChange, tabWidth, variant, ...other }: TabGroupProps): React.JSX.Element; displayName: string; Tab: { ({ "aria-labelledby": ariaLabelledBy, children, className, icon, id, title, ...other }: TabProps): React.JSX.Element; displayName: string; Button: { (props: TabButtonProps): React.JSX.Element; displayName: string; }; }; }; /** * Individual tab within the Tabs component. * - Use the `title` prop for text-only tab headers * - For more custom tab headers use `` which uses a render prop with state information */ export declare const Tab: { ({ "aria-labelledby": ariaLabelledBy, children, className, icon, id, title, ...other }: TabProps): React.JSX.Element; displayName: string; Button: { (props: TabButtonProps): React.JSX.Element; displayName: string; }; }; export {};