-
Notifications
You must be signed in to change notification settings - Fork 9
Switch Specification
- Overview
- User Stories
- Functionality
- Test Scenarios
- Accessibility
- Assumptions and Limitations
- References
Team Name: Design and Web Development (DnD)
Developer: Silvia Ivanova
Designer: Stefan Ivanov
- Simeon Simeonov | Date:
- Product Owner: Radoslav Mirchev | Date:
- Radoslav Karaivanov | Date:
| Version | Users | Date | Notes |
|---|---|---|---|
| 1 | Silvia Ivanova | Date 16 July 2021 | Update specification |
The <igc-switch> component is used to provide a capability for making a binary choice of a single settings option.
It is providing API for the most common use cases when it comes to a binary choice for a certain condition. Switch takes on common visual properties of the radio button.
- The switch component should have a toggle visual representation.
- The switch component should have a clickable button.
- The switch component should have the ability to add a corresponding label (before or after).
Developer stories:
- Story 1: As a developer, I want to be able to provide a way to display a binary choice - true or false.
- Story 2: As a developer, I want to be able to specify the default state of the switch - checked or unchecked.
- Story 3: As a developer, I want to be able to disable the switch.
- Story 4: As a developer, I want to be able to add a corresponding label - before or after the switch.
- Story 5: As a developer, I want to be able to customize the switch size and colors.
<igc-switch checked="true" disabled="true" labelPosition="before">
Checked Switch
</igc-switch>End-user stories:
- Story 1: As an end-user, I want to be shown a visual representation of certain state changes.
3.1. End-User Experience
The switch component should display a toggle changing the state of a single settings option. It comes with 3 different states (checked, unchecked, and disabled) and a corresponding label.
3.2. Developer Experience
checked: Determines the initial state of the switch to checked="true".
disabled: Determines whether the switch is enabled or disabled.
3.5. API
You should be able to configure the igc-switch by setting properties on it.
| Name | Description | Type | Default value | Reflected |
|---|---|---|---|---|
checked |
Determines the initial state of the switch | boolean | false | false |
disabled |
Determines the accessibility state of the switch | boolean | false | false |
| Name | Description |
|---|---|
| (default) |
| Name | Description |
|---|---|
| base | The base wrapper of the switch. |
Automation
- Scenario 1:
-
Roles: - role="checkbox". https://www.w3.org/TR/wai-aria-1.1/#checkbox
-
Attributes: - aria-checked="checked". https://www.w3.org/TR/wai-aria-1.1/#aria-checked
- aria-labelledby="labelId". https://www.w3.org/TR/wai-aria-1.1/#aria-labelledby