Skip to content

Commit

Permalink
Create notifications.rst
Browse files Browse the repository at this point in the history
  • Loading branch information
andersonjeccel committed May 31, 2024
1 parent da1402b commit 4bdc7b6
Showing 1 changed file with 83 additions and 0 deletions.
83 changes: 83 additions & 0 deletions docs/development-environment/design/notifications.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
Notifications
=============

Notifications are a critical component of user experience (UX) in digital products, serving as a bridge between the system and the user. They should enhance, not detract from, the user experience, assisting users in achieving their goals and providing immediate, relevant feedback.

Notification Types and Their Use

Check warning on line 6 in docs/development-environment/design/notifications.rst

View workflow job for this annotation

GitHub Actions / prose

[vale] reported by reviewdog 🐶 [Google.Headings] 'Notification Types and Their Use' should use sentence-style capitalization. Raw Output: {"message": "[Google.Headings] 'Notification Types and Their Use' should use sentence-style capitalization.", "location": {"path": "docs/development-environment/design/notifications.rst", "range": {"start": {"line": 6, "column": 1}}}, "severity": "WARNING"}
===============================

Understanding Notification Variants

Check warning on line 9 in docs/development-environment/design/notifications.rst

View workflow job for this annotation

GitHub Actions / prose

[vale] reported by reviewdog 🐶 [Google.Headings] 'Understanding Notification Variants' should use sentence-style capitalization. Raw Output: {"message": "[Google.Headings] 'Understanding Notification Variants' should use sentence-style capitalization.", "location": {"path": "docs/development-environment/design/notifications.rst", "range": {"start": {"line": 9, "column": 1}}}, "severity": "WARNING"}
-----------------------------------

Notifications come in various forms, each serving a specific purpose within an application:

Check warning on line 12 in docs/development-environment/design/notifications.rst

View workflow job for this annotation

GitHub Actions / prose

[vale] reported by reviewdog 🐶 [Google.WordList] Use 'app' instead of 'application'. Raw Output: {"message": "[Google.WordList] Use 'app' instead of 'application'.", "location": {"path": "docs/development-environment/design/notifications.rst", "range": {"start": {"line": 12, "column": 80}}}, "severity": "WARNING"}

- **Inline Notifications**: These are integrated into task flows to inform users about the status of an action or system changes. They are typically placed at the top of the content area or near the relevant item.

Check warning on line 14 in docs/development-environment/design/notifications.rst

View workflow job for this annotation

GitHub Actions / prose

[vale] reported by reviewdog 🐶 [Google.Colons] ': T' should be in lowercase. Raw Output: {"message": "[Google.Colons] ': T' should be in lowercase.", "location": {"path": "docs/development-environment/design/notifications.rst", "range": {"start": {"line": 14, "column": 27}}}, "severity": "WARNING"}

- **Toast Notifications**: These are time-based messages that appear at the top of the screen and disappear after a short duration. They are used for brief messages that do not require user interaction.

Check warning on line 16 in docs/development-environment/design/notifications.rst

View workflow job for this annotation

GitHub Actions / prose

[vale] reported by reviewdog 🐶 [Google.Colons] ': T' should be in lowercase. Raw Output: {"message": "[Google.Colons] ': T' should be in lowercase.", "location": {"path": "docs/development-environment/design/notifications.rst", "range": {"start": {"line": 16, "column": 26}}}, "severity": "WARNING"}

- **Actionable Notifications**: These include interactive elements and require user interaction. They are styled similarly to inline or toast notifications but are more disruptive due to their interactive nature.

Check warning on line 18 in docs/development-environment/design/notifications.rst

View workflow job for this annotation

GitHub Actions / prose

[vale] reported by reviewdog 🐶 [Google.Colons] ': T' should be in lowercase. Raw Output: {"message": "[Google.Colons] ': T' should be in lowercase.", "location": {"path": "docs/development-environment/design/notifications.rst", "range": {"start": {"line": 18, "column": 31}}}, "severity": "WARNING"}

Design
------

- Carefully examine the context in which notifications will appear. Use them sparingly and only when they add value to the user experience.

Check warning on line 23 in docs/development-environment/design/notifications.rst

View workflow job for this annotation

GitHub Actions / prose

[vale] reported by reviewdog 🐶 [Google.Will] Avoid using 'will'. Raw Output: {"message": "[Google.Will] Avoid using 'will'.", "location": {"path": "docs/development-environment/design/notifications.rst", "range": {"start": {"line": 23, "column": 56}}}, "severity": "WARNING"}
- Maintain consistency in the design and behavior of notifications across the application.

Check warning on line 24 in docs/development-environment/design/notifications.rst

View workflow job for this annotation

GitHub Actions / prose

[vale] reported by reviewdog 🐶 [Google.WordList] Use 'app' instead of 'application'. Raw Output: {"message": "[Google.WordList] Use 'app' instead of 'application'.", "location": {"path": "docs/development-environment/design/notifications.rst", "range": {"start": {"line": 24, "column": 79}}}, "severity": "WARNING"}
- High-contrast notifications are used for critical messaging, while low-contrast notifications are less visually disruptive.

Content
-------

- Notifications should be concise and to the point, with a short and descriptive title. The body content should be limited to one or two sentences.

Actions
-------

- Limit actionable notifications to one action per notification to avoid overwhelming the user.
- Inline notifications should persist until dismissed by the user or resolved through an action. Toast notifications can time out but should also include a close button.

Accessibility
-------------

- Notifications should be accessible and not rely solely on color to convey status, as this can be problematic for users with color blindness, so use additional HTML attributes according to the notification type.
- Toast notifications with interactive content should not automatically disappear to remain WCAG 2.1 compliant.

Using Notification Components

Check warning on line 44 in docs/development-environment/design/notifications.rst

View workflow job for this annotation

GitHub Actions / prose

[vale] reported by reviewdog 🐶 [Google.Headings] 'Using Notification Components' should use sentence-style capitalization. Raw Output: {"message": "[Google.Headings] 'Using Notification Components' should use sentence-style capitalization.", "location": {"path": "docs/development-environment/design/notifications.rst", "range": {"start": {"line": 44, "column": 1}}}, "severity": "WARNING"}
=============================

Standard Notifications with Icons

Check warning on line 47 in docs/development-environment/design/notifications.rst

View workflow job for this annotation

GitHub Actions / prose

[vale] reported by reviewdog 🐶 [Google.Headings] 'Standard Notifications with Icons' should use sentence-style capitalization. Raw Output: {"message": "[Google.Headings] 'Standard Notifications with Icons' should use sentence-style capitalization.", "location": {"path": "docs/development-environment/design/notifications.rst", "range": {"start": {"line": 47, "column": 1}}}, "severity": "WARNING"}
---------------------------------

For standard notifications that include an icon, developers should use a ``<div>`` element with the class ``alert`` and an additional class to specify the type of notification:

- ``.alert-success`` for success messages
- ``.alert-info`` for informational messages
- ``.alert-warning`` for warnings
- ``.alert-danger`` for errors

Each class corresponds to a specific icon and color that will be automatically applied using CSS logic.

Example:

.. code-block:: html

<div class="alert alert-warning" role="alert">
No emails are scheduled to be sent.
</div>

This will display a warning notification with an appropriate icon and color styling.

Larger Notification Blocks Without Icons
----------------------------------------

When a larger notification block is needed, for instance, to include headings or additional content, developers should use the ``alert`` class along with a column class that starts with the ``col-`` prefix. These notifications will not display an icon but will have only a colored left border indicative of the notification type.

Example:

.. code-block:: html

<div class="alert alert-warning col-md-6">
<h4>No Results Found</h4>
<p>Seems there are none! Try changing a filter (if applicable) or how about creating a new one?</p>
</div>

This creates a more substantial notification block with a heading and paragraph, distinguished by a yellow left border for a warning but without an accompanying icon.

0 comments on commit 4bdc7b6

Please sign in to comment.