-
Notifications
You must be signed in to change notification settings - Fork 354
Components
New features and components should follow the following accessibility implementation guidelines:
(for ease of use)
- Visit the following location: https://accessibilityinsights.io/en/
- Install the extension, and test
required:
-
aria-label| string: "Login Button", "Megan Bowen" | - meaningful text should have identifiable labels for screen readers
example (mgt-login):
<button
class="popup-command"
@click=${this.logout}
aria-label="Sign Out">
Sign Out
</button>-
tab-index/focus| string: "0", "-1" | - components that are interactive or display information should be visibilly navigatable bytabkey control. Additional information in the aria label should be displayed when this feature is used.
example (mgt-people):
<mgt-person tabindex="0" ></mgt-person>mgt-person:focus{
border-color: blue;
}-
alt| string: "person icon" | - any<img>tag should containalttext as well
example (mgt-person):
<img
title=${this.personDetails.displayName}
aria-label=${this.personDetails.displayName}
alt=${this.personDetails.displayName}
src=${this.personDetails.image as string}
/>The best way to get started with a new component is to use our snippets for scaffolding:
Note: The steps below assume you are using Visual Studio Code and you've installed all the recommended extensions.
-
Chose a name for your component. The component must be prefixed with
mgt. For examplemgt-component -
Create a new folder for your new component under
src\componentsand name it with the name of your component. -
Create a new typescript file in your new folder with the same name. Ex:
mgt-component.ts -
Open the file and use the
mgtnewsnippet to scaffold the new component.To use a snippet, start typing the name of the snippet (
mgtnew) and presstab -
Tab through the generated code to set the name of your component.
-
Add your code!