beta-parity-react
Version:
Beta Parity React Components
53 lines • 1.42 kB
TypeScript
import React from 'react';
import './index.css';
import './variables.css';
/**
* Props for the TreeNavigation component.
*/
export interface TreeNavigationProps extends React.HTMLAttributes<HTMLElement> {
/**
* The list of navigation items to display.
* Each item can have a title, id, and optional children for nested headings.
*/
items: TreeNavigationItem[];
}
/**
* Represents a single navigation item.
*/
export interface TreeNavigationItem {
id: string;
title: string;
href?: string;
children?: TreeNavigationItem[];
defaultExpanded?: boolean;
defaultActive?: true;
}
/**
* **Tree Navigation Component**
*
* A component that renders a hierarchical navigation tree
* from a provided list of items. It supports expandable/collapsible
* sections and smooth scrolling to the selected section.
*
* @example
* ```tsx
* <TreeNavigation
* items={[
* { id: 'overview', title: 'Overview' },
* {
* id: 'details',
* title: 'Details',
* children: [
* { id: 'specifications', title: 'Specifications' },
* { id: 'features', title: 'Features' }
* ]
* }
* ]}
* color="primary"
* />
* ```
*
* @see {@link https://beta-parity-react.vercel.app/tree-navigation Tree Navigation Documentation}
*/
export declare const TreeNavigation: React.FC<TreeNavigationProps>;
//# sourceMappingURL=index.d.ts.map