-
Notifications
You must be signed in to change notification settings - Fork 7
Snackbar Specification
Team Name: Design and Web Development (DnD)
Developer: Silvia Ivanova
Designer: Stefan Ivanov
- Simeon Simeonov | Date:
- Stefan Ivanov | Date:
- Product Owner: Radoslav Mirchev | Date:
- Radoslav Karaivanov | Date:
| Version | Users | Date | Notes |
|---|---|---|---|
| 1 | Silvia Ivanova | Date 20 January 2022 | Update specification |
The <igc-snackbar> component is used to provide feedback about an operation by showing a brief message at the bottom of the screen.
The <igc-snackbar> component should inform users about a performed action that is important or could be undone. It should not interrupt the user experience thus should be displayed temporarily and close without compulsory user action.
- The snackbar component should represent an update about a process that has been performed.
- The snackbar component should appear above all other screen elements.
- The snackbar component should be placed at the bottom of the screen.
- The snackbar component should contain only one line of text.
- The snackbar component should be able to display an action text.
- The snackbar component should disappear automatically.
- The snackbar component should be able to prevent auto-hiding.
- Only one snackbar can be visible at a time.
- The snackbar component should emit an event when an action is executed.
Developer stories:
- Story 1: As a developer, I want to be able to provide a way to inform a user about an application operation.
- Story 2: As a developer, I want to be able to customize the snackbar message.
- Story 3: As a developer, I want to be able to place an action button inside the snackbar content.
- Story 4: As a developer, I want to be able to specify if the snackbar should hide automatically or not.
- Story 5: As a developer, I want to be able to specify the display time of the snackbar.
- Story 6: As a developer, I want to be able to place content between the opening and closing brackets of the snackbar component, so that it can be used as a corresponding message.
- Story 7: As a developer, I want to be able to listen to action events, so that I can better manage the state of the snackbar component.
- Story 8: As a developer, I want to be able to customize the appearance of the snackbar component, so that it better fits the design language of my application.
End-user stories:
- Story 1: As an end-user, I want to be shown a message notification about a certain operation.
- Story 2: As an end-user, I want to be able to change the snackbar display time duration.
- Story 3: As an end-user, I want to be able to prevent the automatic hiding of the snackbar.
- Story 4: As an end-user, I want to be able to perform an action by pressing a button inside the snackbar.
3.1. End-User Experience
The snackbar component displays a rectangular container with a solid background and a shadow positioned at the bottom of the screen. It contains a single-line text message and an optional action text. Only one snackbar should be displayed at a time and it should be above all other screen elements but without interfering with the navigation. The component can be hidden automatically or by pressing a button.
3.2. Developer Experience
<igc-snackbar keepOpen="true" actionText="Dismiss">
Snackbar Message
</igc-snackbar>3.3. API
You should be able to configure the igc-snackbar by setting its properties:
| Name | Description | Type | Default value | Reflected |
|---|---|---|---|---|
open |
Determines if the snackbar is opened. | boolean | false | true |
displayTime |
Sets the duration of time span in ms in which the snackbar will be visible. | number | 4000 | false |
keepOpen |
Sets whether the snackbar should close after the displayTime is over. |
boolean | false | true |
actionText |
Sets the actionText attribute, which will be displayed in the action button. |
string | - | false |
The igc-snackbar should emit the following events:
| Name | Description | Type |
|---|---|---|
igcAction |
Emitted when the snackbar action is executed |
The igc-snackbar exposes the following methods:
| Name | Description | Arguments |
|---|---|---|
show |
Displays the snackbar. | - |
hide |
Closes the snackbar. | - |
| Name | Description |
|---|---|
| (default) | The snackbar content. |
| Name | Description |
|---|---|
| base | The base wrapper of the snackbar. |
| message | The snackbar message. |
| action | The snackbar action text (button). |
Automation
- Scenario 1: Should change the snackbar display time correctly.
- Scenario 2: Should change the snackbar keepOpen option correctly.
- Scenario 3: Should perform an action when the snackbar action button is clicked.
- Scenario 4: Should emit event when a user action is executed.
Roles: