Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[@mantine/core] Notification: spread closeButtonProps after iconSize, color #2205

Merged
merged 1 commit into from Aug 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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