@grafana/ui
Version:
Grafana Components Library
27 lines (26 loc) • 1.23 kB
TypeScript
import { type HTMLProps } from 'react';
import * as React from 'react';
import { type NavModelItem } from '@grafana/data';
import { type IconName } from '../../types/icon';
export interface TabProps extends HTMLProps<HTMLElement> {
label: string;
active?: boolean;
/** When provided, it is possible to use the tab as a hyperlink. Use in cases where the tabs update location. */
href?: string;
icon?: IconName;
onChangeTab?: (event: React.MouseEvent<HTMLElement>) => void;
/** A number rendered next to the text. Usually used to display the number of items in a tab's view. */
counter?: number | null;
/** Extra content, displayed after the tab label and counter */
suffix?: NavModelItem['tabSuffix'];
truncate?: boolean;
tooltip?: string;
/** When true, the tab will be disabled and not clickable */
disabled?: boolean;
/** When provided, used instead of label for the data-testid. Useful for locale-stable e2e selectors. */
'data-testid'?: string;
}
/**
* https://developers.grafana.com/ui/latest/index.html?path=/docs/navigation-tabs--docs
*/
export declare const Tab: React.ForwardRefExoticComponent<Omit<TabProps, "ref"> & React.RefAttributes<HTMLElement>>;