carbon-react
Version:
A library of reusable React components for easily building user interfaces.
49 lines (48 loc) • 2.11 kB
TypeScript
import React from "react";
import { PaddingProps } from "styled-system";
import { TagProps } from "../../../__internal__/utils/helpers/tags/tags";
export interface TabProps extends PaddingProps, TagProps {
title?: string;
/** A unique ID to identify this specific tab. */
tabId: string;
/** The child elements of Tab component. */
children?: React.ReactNode;
/** @ignore @private Boolean indicating selected state of Tab. */
isTabSelected?: boolean;
/** The position of the Tab. */
position?: "top" | "left";
/** Message displayed when Tab has error */
errorMessage?: string;
/** Message displayed when Tab has warning */
warningMessage?: string;
/** Message displayed when Tab has warning */
infoMessage?: string;
/** Additional content to display with title */
siblings?: React.ReactNode;
/** Position title before or after siblings */
titlePosition?: "before" | "after";
/**
* Allows Tab to be a link
* @deprecated Using tabs as links is inaccessible; this prop will be deprecated in a future release.
* */
href?: string;
/** Overrides default layout with a one defined in this prop */
customLayout?: React.ReactNode;
/** Additional props to be passed to the Tab's corresponding title. */
titleProps?: {
/** Identifier used for testing purposes */
"data-role"?: string;
};
/** @private @ignore */
role?: string;
/** @private @ignore */
ariaLabelledby?: string;
/** @private @ignore */
updateErrors?: (id: string, errors: Record<string, undefined | string | boolean>) => void;
/** @private @ignore */
updateWarnings?: (id: string, warnings: Record<string, undefined | string | boolean>) => void;
/** @private @ignore */
updateInfos?: (id: string, infos: Record<string, undefined | string | boolean>) => void;
}
export declare const Tab: ({ ariaLabelledby, children, isTabSelected, position, role, tabId, updateErrors, updateWarnings, updateInfos, href, title, titleProps, ...rest }: TabProps) => React.JSX.Element;
export default Tab;