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

Function SideNavHeader

packages/@react-spectrum/s2/src/SideNav.tsx:629–655  ·  view source on GitHub ↗
(props: SideNavHeaderProps)

Source from the content-addressed store, hash-verified

627> {}
628
629export const SideNavHeader = (props: SideNavHeaderProps): ReactNode => {
630 let {header} = useContext(SideNavViewTransitionContext);
631 let id = useId();
632 return (
633 <NavigationTreeHeader
634 id={id}
635 // For some reason I'm unable to use a ViewTransition component directly here. Not sure why
636 style={header ? {viewTransitionName: `${id}-header`, viewTransitionClass: header} : undefined}
637 className={style({
638 position: 'relative',
639 // Hidden by the panel rather than by the header itself — see the attribute in SideNavPanel.
640 display: {
641 default: 'block',
642 ':is([data-side-panel-collapsed] *)': 'none'
643 },
644 font: 'ui-sm',
645 // Component/S/Medium for the font, doesn't appear to match our fonts
646 fontWeight: 'medium',
647 color: 'gray-600',
648 paddingStart: 'edge-to-text',
649 marginBottom: '[8px]',
650 height: 16
651 })}>
652 {props.children}
653 </NavigationTreeHeader>
654 );
655};
656
657export interface SideNavItemLinkProps {
658 /** Rendered contents of the link. */

Callers

nothing calls this directly

Calls 1

useIdFunction · 0.90

Tested by

no test coverage detected