MCPcopy Create free account
hub / github.com/adobe/react-spectrum / TabPanel

Function TabPanel

packages/@adobe/react-spectrum/src/tabs/Tabs.tsx:487–510  ·  view source on GitHub ↗
(props: TabPanelProps)

Source from the content-addressed store, hash-verified

485
486// @private
487function TabPanel(props: TabPanelProps) {
488 const {tabState, tabPanelProps: ctxTabPanelProps} = useContext(TabContext)!;
489 const {tabListState} = tabState;
490 let ref = useRef<HTMLDivElement | null>(null);
491 const {tabPanelProps} = useTabPanel(props, tabListState, ref);
492 let {styleProps} = useStyleProps(props);
493
494 if (ctxTabPanelProps['aria-labelledby']) {
495 // oxlint-disable-next-line react/react-compiler
496 tabPanelProps['aria-labelledby'] = ctxTabPanelProps['aria-labelledby'];
497 }
498
499 return (
500 <FocusRing focusRingClass={classNames(styles, 'focus-ring')}>
501 <div
502 {...styleProps}
503 {...tabPanelProps}
504 ref={ref}
505 className={classNames(styles, 'spectrum-TabsPanel-tabpanel', styleProps.className)}>
506 {props.children}
507 </div>
508 </FocusRing>
509 );
510}
511
512interface TabPickerProps<T> extends Omit<SpectrumPickerProps<T>, 'children' | 'onSelectionChange'> {
513 density?: 'compact' | 'regular';

Callers

nothing calls this directly

Calls 3

useStylePropsFunction · 0.90
classNamesFunction · 0.90
useTabPanelFunction · 0.85

Tested by

no test coverage detected