diff --git a/docs/content/Dropdown.md b/docs/content/Dropdown.md index 3db7bb784ea..5843117f9d1 100644 --- a/docs/content/Dropdown.md +++ b/docs/content/Dropdown.md @@ -26,7 +26,7 @@ Dropdown, Dropdown.Menu, and Dropdown.Item all get `COMMON` system props. Read o | Name | Type | Default | Description | | :- | :- | :-: | :- | | direction | String | 'sw' | Sets the direction of the dropdown menu. | -| title | String | | Sets the text inside of the button | +| title | String or Node | | Sets the text inside of the button, can be either a string or a React node | #### Dropdown.Item No additional props. diff --git a/index.d.ts b/index.d.ts index deeb1649689..22fe1fc2bd1 100644 --- a/index.d.ts +++ b/index.d.ts @@ -149,7 +149,7 @@ declare module '@primer/components' { export interface DropdownMenuProps extends CommonProps, Omit, 'color'> { direction?: string - title: string + title: string | React.ReactNode } export const Dropdown: React.FunctionComponent & { diff --git a/src/Dropdown.js b/src/Dropdown.js index 780dc3eb730..4b1285308b3 100644 --- a/src/Dropdown.js +++ b/src/Dropdown.js @@ -139,7 +139,7 @@ Dropdown.Item.propTypes = { Dropdown.defaultProps = {theme} Dropdown.propTypes = { children: PropTypes.node, - title: PropTypes.string, + title: PropTypes.oneOfType([PropTypes.string, PropTypes.node]), ...COMMON.propTypes }