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

Function ExpandableRowChevron

packages/@react-spectrum/s2/src/SideNav.tsx:568–609  ·  view source on GitHub ↗
(props: ExpandableRowChevronProps)

Source from the content-addressed store, hash-verified

566});
567
568function ExpandableRowChevron(props: ExpandableRowChevronProps) {
569 let expandButtonRef = useRef<HTMLButtonElement>(null);
570 let [fullProps, ref] = useContextProps(
571 {...props, slot: 'chevron'},
572 expandButtonRef,
573 ButtonContext
574 );
575 let {isExpanded, scale, isHidden, isCollapsed} = fullProps;
576 let {direction} = useLocale();
577
578 return (
579 <Button
580 {...props}
581 ref={ref}
582 slot="chevron"
583 className={renderProps =>
584 expandButton({
585 ...renderProps,
586 isExpanded,
587 isCollapsed,
588 isRTL: direction === 'rtl',
589 scale,
590 isHidden
591 })
592 }>
593 <Chevron
594 className={style({
595 scale: {
596 direction: {
597 ltr: '1',
598 rtl: '-1'
599 }
600 },
601 '--iconPrimary': {
602 type: 'fill',
603 value: 'currentColor'
604 }
605 })({direction})}
606 />
607 </Button>
608 );
609}
610
611export interface SideNavSectionProps<T> extends Omit<
612 NavigationTreeSectionProps<T>,

Callers

nothing calls this directly

Calls 2

useLocaleFunction · 0.90
useContextPropsFunction · 0.85

Tested by

no test coverage detected