import React, { forwardRef } from "react"; import { cl } from "../../../utils/helpers"; import { useTabPanel } from "./useTabPanel"; export interface TabPanelProps extends React.HTMLAttributes { /** * Tab panel content. */ children: React.ReactNode; /** * Value for state-handling. */ value: string; /** * If true, will only render children when selected. * @default true */ lazy?: boolean; /** * Overrides auto-generated id. * * **Warning**: TabPanel generates an id if not provided. If you need to override it, * make sure to also include the correct `aria-labelledby` id for the Tab that labels it. */ id?: string; } const TabPanel = forwardRef( ({ className, value, children, lazy = true, id, ...rest }, ref) => { const ctx = useTabPanel({ value }); return ( ); }, ); export default TabPanel;