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

Function HiddenTabs

packages/@react-spectrum/s2/src/Tabs.tsx:638–678  ·  view source on GitHub ↗
(props: {
  listRef: RefObject<HTMLDivElement | null>;
  items: Array<Node<any>>;
  size?: string;
  density?: 'compact' | 'regular';
})

Source from the content-addressed store, hash-verified

636const HiddenTabsContext = createContext(false);
637
638let HiddenTabs = function (props: {
639 listRef: RefObject<HTMLDivElement | null>;
640 items: Array<Node<any>>;
641 size?: string;
642 density?: 'compact' | 'regular';
643}) {
644 let {listRef, items = [], size, density} = props;
645
646 return (
647 <div
648 // @ts-ignore
649 inert={inertValue(true)}
650 ref={listRef}
651 className={style({
652 display: 'inherit',
653 flexDirection: 'inherit',
654 gap: 'inherit',
655 flexWrap: 'inherit',
656 position: 'absolute',
657 inset: 0,
658 visibility: 'hidden',
659 overflow: 'hidden',
660 opacity: 0
661 })}>
662 <HiddenTabsContext.Provider value>
663 {items.map(item => {
664 // pull off individual props as an allow list, don't want refs or other props getting through
665 return (
666 <div
667 data-hidden-tab
668 style={item.props.UNSAFE_style}
669 key={item.key}
670 className={item.props.className({size, density})}>
671 {item.props.children({size, density})}
672 </div>
673 );
674 })}
675 </HiddenTabsContext.Provider>
676 </div>
677 );
678};
679
680let TabsMenu = (
681 props: {

Callers

nothing calls this directly

Calls 1

inertValueFunction · 0.90

Tested by

no test coverage detected