@mskcc/carbon-react
Version:
Carbon react components for the MSKCC DSM
126 lines (125 loc) • 3.83 kB
TypeScript
import { ReactNode } from 'react';
import PropTypes from 'prop-types';
export type ControlItemProps = {
icon?: string;
onClick?: () => void;
active?: boolean;
};
export type NavItemProps = {
label?: string;
href?: string;
active?: boolean;
};
export interface HeaderProps {
/**
* Center navigation area to house custom elements
*/
appMenu?: ReactNode;
/**
* Right controls area to house custom elements
*/
controls?: ReactNode;
/**
* Pass an array of control items with a pre-defined data structure.
*/
controlItems?: ControlItemProps[];
/**
* Provide the href attribute for the logo
*/
logoHref?: string;
/**
* Specify the location of the logo file
*/
logoSrc?: string;
/**
* Pass an array of navigation items with a pre-defined data structure.
*/
navItems?: NavItemProps[];
/**
* Left logo area to house custom elements.
*/
product?: ReactNode;
/**
* Specify the string to the right of the logo
*/
productName?: ReactNode;
/**
* Specify the href attribute for the hidden accessibility skip link.
*/
skipHref?: string;
/**
* Specify the max width of the contents inside the header
*/
maxWidth?: 'default' | 'fluid' | 'max';
/**
* Keep the header fixed to the top of the page
*/
fixed?: boolean;
/**
* custom classes
*/
className?: string;
}
export declare const Header: {
({ appMenu, controls, controlItems, logoHref, logoSrc, navItems, product, productName, skipHref, maxWidth, className, fixed, }: HeaderProps): JSX.Element;
displayName: string;
propTypes: {
/**
* Center navigation area to house custom elements
*/
appMenu: PropTypes.Requireable<PropTypes.ReactNodeLike>;
/**
* custom classes
* */
className: PropTypes.Requireable<string>;
/**
* Pass an array of control items with a pre-defined data structure.
*/
controlItems: PropTypes.Requireable<(PropTypes.InferProps<{
icon: PropTypes.Requireable<string>;
onClick: PropTypes.Requireable<(...args: any[]) => any>;
active: PropTypes.Requireable<boolean>;
}> | null | undefined)[]>;
/**
* Right controls area to house custom elements
*/
controls: PropTypes.Requireable<PropTypes.ReactNodeLike>;
/**
* Keep the header fixed to the top of the page
* */
fixed: PropTypes.Requireable<boolean>;
/**
* Provide the href attribute for the logo
*/
logoHref: PropTypes.Requireable<string>;
/**
* Specify the location of the logo file
*/
logoSrc: PropTypes.Requireable<string>;
/**
* Specify the max width of the contents inside the header
*/
maxWidth: PropTypes.Requireable<string>;
/**
* Pass an array of navigation items with a pre-defined data structure.
*/
navItems: PropTypes.Requireable<(PropTypes.InferProps<{
label: PropTypes.Requireable<string>;
href: PropTypes.Requireable<string>;
active: PropTypes.Requireable<boolean>;
}> | null | undefined)[]>;
/**
* Left logo area to house custom elements.
*/
product: PropTypes.Requireable<PropTypes.ReactNodeLike>;
/**
* Specify the string to the right of the logo
*/
productName: PropTypes.Requireable<PropTypes.ReactNodeLike>;
/**
* Specify the href attribute for the hidden accessibility skip link.
*/
skipHref: PropTypes.Requireable<string>;
};
};
export default Header;