export interface FormNavigationItem { id: string; label: string; } export type FormNavigationData = FormNavigationItem[]; export interface FormNavigationClassNames { base?: string; navigationWrapper?: string; list?: string; listItemWrapper?: string; listItem?: string; accent?: string; } interface Props { navData: FormNavigationData; /** * Highlight every section currently in view instead of just the topmost one. * In this mode several nav items can be active at once. */ multiple?: boolean; /** Id of the scrollable container. Omit to observe against the viewport. */ containerId?: string; /** Controlled active section id (single mode). Omit for internally-managed state. */ activeSection?: string; /** Controlled active section ids (multiple mode). Takes precedence over `activeSection`. */ activeSections?: string[]; /** Initial active section for uncontrolled mode. Defaults to the first item. */ defaultActiveSection?: string; /** Notified with the topmost active section whenever it changes (scroll or click). */ onSectionChange?(id: string): void; /** Notified with the full set of active section ids whenever it changes. */ onActiveSectionsChange?(ids: string[]): void; /** Scroll behavior when a nav item is clicked. Default: "smooth". */ scrollBehavior?: ScrollBehavior; /** * `IntersectionObserver` rootMargin controlling when a section counts as active. * Defaults to the upper viewport in single mode, and the whole viewport in `multiple` mode. */ rootMargin?: string; className?: string; classNames?: FormNavigationClassNames; } /** * Sticky side navigation with scroll-spy. Tracks which `
` is in view via * `IntersectionObserver` and highlights the matching item(s); clicking an item smooth-scrolls to it. * Single mode (default) highlights the topmost visible section with a sliding accent; `multiple` * mode highlights every visible section. Works uncontrolled or controlled. */ export default function FormNavigation({ navData, multiple, containerId, activeSection, activeSections, defaultActiveSection, onSectionChange, onActiveSectionsChange, scrollBehavior, rootMargin, className, classNames, }: Props): import("react").JSX.Element; export {};