interface AnchorProps {
    affix?: boolean;
    bounds?: number;
    children?: ReactNode;
    className?: string;
    direction?: AnchorDirection;
    getContainer?: (() => AnchorContainer);
    getCurrentAnchor?: ((activeLink) => string);
    items?: AnchorLinkItemProps[];
    offsetTop?: number;
    onChange?: ((currentActiveLink) => void);
    onClick?: ((e, link) => void);
    prefixCls?: string;
    replace?: boolean;
    rootClassName?: string;
    showInkInFixed?: boolean;
    style?: CSSProperties;
    targetOffset?: number;
}

Properties

affix?: boolean
bounds?: number
children?: ReactNode

Deprecated

Please use items instead.

className?: string
direction?: AnchorDirection
getContainer?: (() => AnchorContainer)

Type declaration

    • (): AnchorContainer
    • Returns AnchorContainer

getCurrentAnchor?: ((activeLink) => string)

Return customize highlight anchor

Type declaration

    • (activeLink): string
    • Return customize highlight anchor

      Parameters

      • activeLink: string

      Returns string

items?: AnchorLinkItemProps[]
offsetTop?: number
onChange?: ((currentActiveLink) => void)

Listening event when scrolling change active link

Type declaration

    • (currentActiveLink): void
    • Listening event when scrolling change active link

      Parameters

      • currentActiveLink: string

      Returns void

onClick?: ((e, link) => void)

Type declaration

    • (e, link): void
    • Parameters

      • e: MouseEvent<HTMLElement, MouseEvent>
      • link: {
            href: string;
            title: ReactNode;
        }
        • href: string
        • title: ReactNode

      Returns void

prefixCls?: string
replace?: boolean
rootClassName?: string
showInkInFixed?: boolean
style?: CSSProperties
targetOffset?: number

Scroll to target offset value, if none, it's offsetTop prop value or 0.

Generated using TypeDoc