FAST Design is an open-source collection of web tools and components developed by Microsoft, designed to help us build modern, fast, and accessible web interfaces.
FAST, an acronym for Flexible and Scalable Toolkit, is built on principles of modularity and extensibility. This means it allows us to adapt and customize components according to the specific needs of our projects.
It is compatible with multiple technologies and frameworks, including Vanilla, React, Vue, Angular, ASP.NET, and Blazor, among others.
Some of the main features of FAST Design are,
- Modularity: FAST components are modular, allowing us to include only what we need, reducing dependency weight and improving performance.
- Accessibility: FAST focuses on accessibility, ensuring components comply with web accessibility standards (WCAG).
- Customization: Components are highly customizable through styles and configurations, allowing for seamless integration with our applications’ visual design.
- Performance: Optimized for performance, FAST components are lightweight and designed to load and run quickly.
For more information about FAST Design, you can check the official FAST documentation and explore the GitHub repository for additional examples and source code.
Installing FAST Design
To start using FAST Design in our project, we first need to install the necessary packages. We can do this using npm, the package manager for Node.js.
Run the following command in the root of our project:
npm install —save @microsoft/fast-components
With the packages installed, we are ready to start using FAST Design in our application.
How to Use FAST Design
Using Predefined Components
FAST Design provides a variety of predefined components that we can use directly in our application. Let’s look at some examples of how to use some of these components, such as buttons and text inputs.
import { provideFASTDesignSystem, fastButton, fastTextField } from '@microsoft/fast-components';
provideFASTDesignSystem()
.register(fastButton(), fastTextField());
document.body.innerHTML = `
<fast-button>Click me</fast-button>
<fast-text-field placeholder="Enter text here"></fast-text-field>
`;
In this example, we use provideFASTDesignSystem to register the fastButton and fastTextField components, and then we use them in our application’s HTML.
Creating a Basic Component
To demonstrate how to use FAST Design, we will create a basic web component. First, we define a custom component using @microsoft/fast-element and @microsoft/fast-foundation.
import { FASTElement, customElement, html } from '@microsoft/fast-element';
const template = html`
<div>
<h1>Hello, FAST Design</h1>
<p>This is a basic component created with FAST Design.</p>
</div>
`;
@customElement({ name: 'hello-fast', template })
class HelloFast extends FASTElement {}
In this example, we use FASTElement to define our component and customElement to register the component with the name hello-fast. The template defines the HTML structure of the component.
Customizing Styles
We can customize the styles of FAST Design components using CSS. The following is an example of how to apply custom styles to a button.
<fast-button class="custom-button">Custom Button</fast-button>
<style>
.custom-button {
background-color: #0078d4;
color: white;
border-radius: 4px;
padding: 10px 20px;
}
</style>
In this example, we apply custom styles to the fast-button using the custom-button class.

