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

Function NavigationTree

starters/tailwind/src/NavigationTree.tsx:21–38  ·  view source on GitHub ↗
({
  renderLink,
  children,
  ...props
}: NavigationTreeProps<T> & {renderLink?: LinkProps['render']})

Source from the content-addressed store, hash-verified

19import {composeTailwindRenderProps, focusRing} from './utils';
20
21export function NavigationTree<T>({
22 renderLink,
23 children,
24 ...props
25}: NavigationTreeProps<T> & {renderLink?: LinkProps['render']}) {
26 return (
27 <RenderLinkContext.Provider value={renderLink}>
28 <AriaNavigationTree
29 {...props}
30 className={composeTailwindRenderProps(
31 props.className,
32 'w-56 max-w-full max-h-72 overflow-auto flex flex-col p-1 gap-0.5 relative border border-neutral-200 dark:border-neutral-700 rounded-lg bg-white dark:bg-neutral-900 outline-none'
33 )}>
34 {children}
35 </AriaNavigationTree>
36 </RenderLinkContext.Provider>
37 );
38}
39
40// The focus ring lives on the row (not the link) so it spans the whole item. Hover/current/ancestor
41// state is surfaced as a leading-edge indicator (see indicatorStyles) rather than a full-row

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected