Skip to content

Commit

Permalink
feat(dev-toolbar-reference): Add level property to notifications (#7200)
Browse files Browse the repository at this point in the history
Co-authored-by: Sarah Rainsberger <[email protected]>
  • Loading branch information
Princesseuh and sarah11918 authored Mar 8, 2024
1 parent 2dd3cf2 commit 9630a14
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/content/docs/en/reference/dev-toolbar-app-reference.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,20 @@ This event can be sent to inform the user that the app requires attention.

Indicates whether or not the app has a notification for the user. When `true`, the app icon will be highlighted using a red dot. Conversely, when `false`, the highlight will be removed. If this property is not specified, `true` will be assumed.

#### `level: 'error' | 'warning' | 'info'`

Indicates the level of the notification. This will be used to determine the color and shape (dark pink circle, gold triangle, or blue square) of the highlight on the app icon. If this property is not specified, `'error'` will be assumed.

```ts
eventTarget.dispatchEvent(
new CustomEvent("toggle-notification", {
detail: {
level: "warning",
},
})
);
```

### `toggle-app`

This event can be sent from your app to change the state of your app. This can be useful, for instance, to implement a "Close" button in your app's UI.
Expand Down

0 comments on commit 9630a14

Please sign in to comment.