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

Function TabList

packages/@react-spectrum/s2/src/Tabs.tsx:291–317  ·  view source on GitHub ↗
(props: TabListProps<T>)

Source from the content-addressed store, hash-verified

289);
290
291export function TabList<T>(props: TabListProps<T>): ReactNode | null {
292 let {showTabs, menuId, valueId, tabs, listRef, onSelectionChange, ariaLabel, ariaDescribedBy} =
293 useContext(CollapseContext) ?? {};
294 let {density, orientation, labelBehavior} = useContext(InternalTabsContext);
295
296 if (showTabs) {
297 return <TabListInner {...props} />;
298 }
299
300 return (
301 <div className={tablistWrapper(null, props.styles)}>
302 {listRef && (
303 <div className={tablist({orientation, labelBehavior, density})}>
304 <HiddenTabs items={tabs} density={density} listRef={listRef} />
305 </div>
306 )}
307 <TabsMenu
308 id={menuId}
309 valueId={valueId}
310 items={tabs}
311 onSelectionChange={onSelectionChange}
312 aria-label={ariaLabel}
313 aria-describedby={ariaDescribedBy}
314 />
315 </div>
316 );
317}
318
319function TabListInner<T>(props: TabListProps<T>) {
320 let {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected