UNPKG

@stanfordspezi/spezi-web-design-system

Version:

Stanford Biodesign Digital Health Spezi Web Design System

39 lines (38 loc) 1.14 kB
import { ComponentProps, ReactNode } from 'react'; import { DropdownMenuContent } from '../../DropdownMenu'; interface RowDropdownMenuProps extends Pick<ComponentProps<typeof DropdownMenuContent>, "align"> { /** * Pass DropdownMenuContent children. */ children?: ReactNode; /** * Unique name of an item */ itemName?: string; } /** * Standard DataTable row actions dropdown menu. * * Typically used within a DataTable column definition to provide per-row actions. * * @example * ```tsx * // Basic usage inside a DataTable column * columnHelper.display({ * id: "actions", * header: "", * cell: (props) => ( * <RowDropdownMenu itemName={props.row.original.name}> * <DropdownMenuItem asChild> * <Link href="/details">View</Link> * </DropdownMenuItem> * <DropdownMenuItem onClick={() => handleDelete(props.row.original)}> * Delete * </DropdownMenuItem> * </RowDropdownMenu> * ), * }); * ``` */ export declare const RowDropdownMenu: ({ children, itemName, align, }: RowDropdownMenuProps) => import("react").JSX.Element; export {};