infinity-ui-elements
Version:
A React TypeScript component library with Tailwind CSS design system
102 lines • 2.32 kB
TypeScript
import * as React from "react";
export interface DropdownMenuItem {
id: string | number;
title: string;
description?: string;
leadingIcon?: React.ReactNode;
trailingIcon?: React.ReactNode;
isDisabled?: boolean;
onClick?: () => void;
}
export interface DropdownMenuProps {
/**
* Items to display in the dropdown
*/
items?: DropdownMenuItem[];
/**
* Custom content to render instead of the default item list
*/
customContent?: React.ReactNode;
/**
* Section heading text
*/
sectionHeading?: string;
/**
* Whether the dropdown is in loading state
*/
isLoading?: boolean;
/**
* Whether to show empty/no results state
*/
isEmpty?: boolean;
/**
* Empty state title
*/
emptyTitle?: string;
/**
* Empty state description
*/
emptyDescription?: string;
/**
* Empty state link text
*/
emptyLinkText?: string;
/**
* Empty state link click handler
*/
onEmptyLinkClick?: () => void;
/**
* Primary button text
*/
primaryButtonText?: string;
/**
* Secondary button text
*/
secondaryButtonText?: string;
/**
* Primary button click handler
*/
onPrimaryClick?: () => void;
/**
* Secondary button click handler
*/
onSecondaryClick?: () => void;
/**
* Show chevron on list items
*/
showChevron?: boolean;
/**
* Custom empty state icon
*/
emptyIcon?: React.ReactNode;
/**
* Disable footer buttons
*/
disableFooter?: boolean;
/**
* Whether to show the footer actions (overrides disableFooter)
*/
showFooter?: boolean;
/**
* Footer layout orientation
*/
footerLayout?: "horizontal" | "vertical";
/**
* Callback when menu should close
*/
onClose?: () => void;
/**
* Focused item index (for keyboard navigation)
*/
focusedIndex?: number;
/**
* Custom class name
*/
className?: string;
/**
* Width of the dropdown menu
*/
width?: "auto" | "full" | string;
}
export declare const DropdownMenu: React.ForwardRefExoticComponent<DropdownMenuProps & React.RefAttributes<HTMLDivElement>>;
//# sourceMappingURL=DropdownMenu.d.ts.map