From ff710927cbd5a2936eb5929acb96b654e6b94977 Mon Sep 17 00:00:00 2001 From: Shelby Date: Thu, 20 Dec 2018 10:47:27 -0800 Subject: [PATCH] Add menu item classnames (#3251) * Add menu item label classname * Add text classname prop * Alphabetize props & improve docs --- packages/core/src/components/menu/menuItem.tsx | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/packages/core/src/components/menu/menuItem.tsx b/packages/core/src/components/menu/menuItem.tsx index 6fb805944e..b0c0c9a4f0 100644 --- a/packages/core/src/components/menu/menuItem.tsx +++ b/packages/core/src/components/menu/menuItem.tsx @@ -46,6 +46,11 @@ export interface IMenuItemProps extends IActionProps, ILinkProps { */ label?: string; + /** + * A space-delimited list of class names to pass along to the right-aligned label wrapper element. + */ + labelClassName?: string; + /** * Right-aligned label content, useful for displaying hotkeys. */ @@ -76,6 +81,11 @@ export interface IMenuItemProps extends IActionProps, ILinkProps { * @default "a" */ tagName?: keyof JSX.IntrinsicElements; + + /** + * A space-delimited list of class names to pass along to the text wrapper element. + */ + textClassName?: string; } export class MenuItem extends React.PureComponent> { @@ -101,6 +111,7 @@ export class MenuItem extends React.PureComponent - + {text} {this.maybeRenderLabel(labelElement)} @@ -136,12 +147,12 @@ export class MenuItem extends React.PureComponent + {label} {labelElement}