# Functions (/themes/sdk/reference/navigation/functions)

```ts
import { … } from '@poltura/theme-sdk/navigation';
```

## `findCategory` [#findcategory]

Finds a category of the navigation tree by its id or by the path of its handles.

```ts
findCategory(nav: NavData, by: {
    readonly id: string;
} | {
    readonly path: readonly string[];
}): NavCategory | null
```

**Parameters**

- `nav: NavData`: The tree, from [`useNavData`](/themes/sdk/reference/navigation/hooks#usenavdata).
- `by: { readonly id: string; } | { readonly path: readonly string[]; }`: The category's id, or the handles from the top-level category down.

**Returns:** The category with its subcategories, or null when the tree has none such.

**Example**

```tsx
import { findCategory, useNavData } from '@poltura/theme-sdk/navigation';

export function SubcategoryLinks({ id }: { id: string }) {
  const category = findCategory(useNavData(), { id });
  return (
    <ul>
      {category?.children.map((child) => (
        <li key={child.id}>
          <a href={child.href}>{child.name}</a>
        </li>
      ))}
    </ul>
  );
}
```
