UNPKG

@carbon/react

Version:

React components for the Carbon Design System

57 lines (56 loc) 1.84 kB
/** * Copyright IBM Corp. 2016, 2025 * * This source code is licensed under the Apache-2.0 license found in the * LICENSE file in the root directory of this source tree. */ import { WeakValidationMap } from 'prop-types'; import { ComponentType, ElementType, JSX, ReactNode } from 'react'; import { LinkProps } from './Link'; export type SideNavLinkProps<E extends ElementType> = LinkProps<E> & { /** * Required props for the accessibility label */ 'aria-label'?: string; /** * Required props for the accessibility label */ 'aria-labelledby'?: string; /** * Specify the text content for the link */ children: ReactNode; /** * Provide an optional class to be applied to the containing node */ className?: string; /** * Specify whether the link is the current page */ isActive?: boolean; /** * Property to indicate if the side nav container is open (or not). Use to * keep local state and styling in step with the SideNav expansion state. */ isSideNavExpanded?: boolean; /** * Specify if this is a large variation of the SideNavLink */ large?: boolean; /** * A component used to render an icon. */ renderIcon?: ComponentType; /** * Optional prop to specify the tabIndex of the button. If undefined, it will be applied default validation */ tabIndex?: number; }; export interface SideNavLinkComponent { <E extends ElementType = 'a'>(props: SideNavLinkProps<E>): JSX.Element | null; displayName?: string; propTypes?: WeakValidationMap<SideNavLinkProps<any>>; } declare const SideNavLink: SideNavLinkComponent; export declare const createCustomSideNavLink: (element: any) => (props: any) => import("react/jsx-runtime").JSX.Element; export default SideNavLink;