Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

Latest commit

 

History

History
44 lines (31 loc) · 779 Bytes

use-side-navigation.md

File metadata and controls

44 lines (31 loc) · 779 Bytes

useSideNavigation

useSideNavigation is a React hook for managing SideNavigation's state with React Router.

Table of Contents

State

activeHref

SideNavigation's activeHref prop

handleFollow

SideNavigation's onFollow prop

Examples

import SideNavigation from '@awsui/components-react/side-navigation';
import { useSideNavigation } from 'use-next-awsui';

const ITEMS = [
  // ...
];

export default function MySideNavigation() {
  const { activeHref, handleFollow } = useSideNavigation();

  return (
    <SideNavigation
      activeHref={activeHref}
      items={ITEMS}
      onFollow={handleFollow}
    />
  );
}