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

(HDS-2149) fix Notification Toast Core example #1232

Merged
merged 1 commit into from
Mar 5, 2024
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ Changes that are not related to specific components
#### Fixed

- [Component] What bugs/typos are fixed?
- [Notification] Fix Core showing and hiding Toast Notification example

### Figma

Expand Down
8 changes: 6 additions & 2 deletions site/src/docs/components/notification/code.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -118,15 +118,19 @@ import { Notification, Button } from 'hds-react';
```

```html
<section aria-label="Notification" class="hds-notification hds-notification--top-right">
<button type="button" onclick="document.getElementById('toast-container').style.display = 'inherit';" class="hds-button hds-button--primary">
<span class="hds-button__label">Show toast</span>
</button>

<section id="toast-container" style="display: none;" aria-label="Notification" class="hds-notification hds-notification--top-right">
<div role="alert" class="hds-notification__content">
<div class="hds-notification__label">
<span class="hds-icon hds-icon--info-circle-fill" aria-hidden="true"></span>
<span>New messages</span>
</div>
<div class="hds-notification__body">You have received new messages.</div>
</div>
<button class="hds-notification__close-button" aria-label="Close toast" type="button" onclick="">
<button class="hds-notification__close-button" aria-label="Close toast" type="button" onclick="document.getElementById('toast-container').style.display = 'none';">
<span class="hds-icon hds-icon--cross" aria-hidden="true"></span>
</button>
</section>
Expand Down
Loading