Skip to content

Commit

Permalink
[docs] Explain how <Alert icon={false} /> behaves (mui#28348)
Browse files Browse the repository at this point in the history
Co-authored-by: eps1lon <silbermann.sebastian@gmail.com>
  • Loading branch information
nguyenkhanhnam and eps1lon authored Sep 17, 2021
1 parent 8e4fadb commit 12a2b3e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docs/translations/api-docs/alert/alert.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"classes": "Override or extend the styles applied to the component. See <a href=\"#css\">CSS API</a> below for more details.",
"closeText": "Override the default label for the <em>close popup</em> icon button.<br>For localization purposes, you can use the provided <a href=\"/guides/localization/\">translations</a>.",
"color": "The main color for the alert. Unless provided, the value is taken from the <code>severity</code> prop.",
"icon": "Override the icon displayed before the children. Unless provided, the icon is mapped to the value of the <code>severity</code> prop.",
"icon": "Override the icon displayed before the children. Unless provided, the icon is mapped to the value of the <code>severity</code> prop. Set to <code>false</code> to remove the <code>icon</code>.",
"iconMapping": "The component maps the <code>severity</code> prop to a range of different icons, for instance success to <code>&lt;SuccessOutlined&gt;</code>. If you wish to change this mapping, you can provide your own. Alternatively, you can use the <code>icon</code> prop to override the icon displayed.",
"onClose": "Callback fired when the component requests to be closed. When provided and no <code>action</code> prop is set, a close icon button is displayed that triggers the callback when clicked.<br><br><strong>Signature:</strong><br><code>function(event: React.SyntheticEvent) =&gt; void</code><br><em>event:</em> The event source of the callback.",
"role": "The ARIA role attribute of the element.",
Expand Down
3 changes: 2 additions & 1 deletion packages/mui-material/src/Alert/Alert.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,9 @@ export interface AlertProps extends StandardProps<PaperProps, 'variant'> {
/**
* Override the icon displayed before the children.
* Unless provided, the icon is mapped to the value of the `severity` prop.
* Set to `false` to remove the `icon`.
*/
icon?: React.ReactNode | false;
icon?: React.ReactNode;
/**
* The ARIA role attribute of the element.
* @default 'alert'
Expand Down
1 change: 1 addition & 0 deletions packages/mui-material/src/Alert/Alert.js
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@ Alert.propTypes /* remove-proptypes */ = {
/**
* Override the icon displayed before the children.
* Unless provided, the icon is mapped to the value of the `severity` prop.
* Set to `false` to remove the `icon`.
*/
icon: PropTypes.node,
/**
Expand Down

0 comments on commit 12a2b3e

Please sign in to comment.