Skip to content

Commit

Permalink
[@mantine/core] Notification: spread closeButtonProps after iconSize,…
Browse files Browse the repository at this point in the history
… color (#2205)
  • Loading branch information
emewjin committed Aug 22, 2022
1 parent 8017631 commit 57a9fec
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
9 changes: 9 additions & 0 deletions docs/src/docs/core/Notification.mdx
Expand Up @@ -32,6 +32,15 @@ Notification component has 3 variants:

<Demo data={NotificationDemos.configurator} />

## CloseButtonProps

To customize CloseButton inside Notification, you can pass `CloseButtonProps`.

```tsx
<Notification closeButtonProps={{ color: 'red' }} />
<Notification closeButtonProps={{ iconSize: 20 }} />
```

## Accessibility

To support screen readers set close button aria-label or title with `closeButtonProps`:
Expand Down
2 changes: 1 addition & 1 deletion src/mantine-core/src/Notification/Notification.tsx
Expand Up @@ -93,9 +93,9 @@ export const Notification = forwardRef<HTMLDivElement, NotificationProps>((props

{!disallowClose && (
<CloseButton
{...closeButtonProps}
iconSize={16}
color="gray"
{...closeButtonProps}
onClick={onClose}
className={classes.closeButton}
/>
Expand Down

0 comments on commit 57a9fec

Please sign in to comment.