Convert Figma logo to code with AI

microsoft logofast

The adaptive interface system for modern web experiences.

9,237
590
9,237
59

Top Related Projects

Spectrum Web Components

A powerful cross-platform UI toolkit for building native-quality iOS, Android, and Progressive Web Apps with HTML, CSS, and JavaScript.

Modular and customizable Material Design UI components for the web

12,566

A collection of professionally designed, every day UI components built on Web standards. SHOELACE IS BECOMING WEB AWESOME 👇👇👇

A suite of polyfills supporting the HTML Web Components specs

Quick Overview

FAST is an adaptive interface system for building modern web experiences developed by Microsoft. It provides a set of technologies and tools that enable developers to create fast, accessible, and customizable web components and design systems.

Pros

  • Highly performant and lightweight components
  • Flexible and customizable design system
  • Strong focus on accessibility and inclusivity
  • Seamless integration with popular web frameworks

Cons

  • Steeper learning curve compared to some other UI libraries
  • Limited ecosystem and community support compared to more established frameworks
  • Documentation can be overwhelming for beginners
  • Some components may lack advanced features found in other libraries

Code Examples

Creating a FAST button:

import { FASTElement, customElement, attr, html, css } from "@microsoft/fast-element";

const template = html<MyButton>`
  <button class="control">${x => x.text}</button>
`;

const styles = css`
  .control {
    background: var(--neutral-fill-rest);
    color: var(--neutral-foreground-rest);
    border: calc(var(--stroke-width) * 1px) solid var(--neutral-stroke-rest);
    border-radius: var(--corner-radius);
    padding: 5px 10px;
  }
`;

@customElement({
  name: "my-button",
  template,
  styles,
})
export class MyButton extends FASTElement {
  @attr text: string = "Click me";
}

Using FAST Design Tokens:

import { parseColorHexRGB } from "@microsoft/fast-colors";
import { DesignToken } from "@microsoft/fast-foundation";

const accentColor = DesignToken.create<string>("accent-color").withDefault("#0078D4");

const parsedColor = parseColorHexRGB(accentColor.getValueFor(element));

Creating a responsive layout with FAST:

import { FASTElement, customElement, html, css } from "@microsoft/fast-element";

const template = html<MyLayout>`
  <div class="container">
    <slot name="header"></slot>
    <div class="content">
      <slot name="sidebar"></slot>
      <slot></slot>
    </div>
    <slot name="footer"></slot>
  </div>
`;

const styles = css`
  .container {
    display: grid;
    grid-template-rows: auto 1fr auto;
    min-height: 100vh;
  }
  .content {
    display: grid;
    grid-template-columns: 200px 1fr;
  }
  @media (max-width: 768px) {
    .content {
      grid-template-columns: 1fr;
    }
  }
`;

@customElement({
  name: "my-layout",
  template,
  styles,
})
export class MyLayout extends FASTElement {}

Getting Started

To start using FAST in your project:

  1. Install the necessary packages:

    npm install @microsoft/fast-components @microsoft/fast-element
    
  2. Import and use FAST components in your application:

    import { FASTDesignSystemProvider, FASTButton } from "@microsoft/fast-components";
    
    FASTDesignSystemProvider;
    FASTButton;
    
    const provider = document.createElement("fast-design-system-provider");
    const button = document.createElement("fast-button");
    button.textContent = "Click me!";
    
    provider.appendChild(button);
    document.body.appendChild(provider);
    
  3. Customize the design system by setting design tokens:

    provider.setAttribute("use-defaults", "false");
    provider.setAttribute("background-color", "#FFFFFF");
    provider.setAttribute("accent-base-color", "#0078D4");
    

Competitor Comparisons

Spectrum Web Components

Pros of Spectrum Web Components

  • Comprehensive design system based on Adobe's Spectrum design language
  • Extensive set of pre-built, accessible components
  • Strong integration with Adobe's ecosystem and tools

Cons of Spectrum Web Components

  • Larger bundle size due to the extensive component library
  • Steeper learning curve for developers unfamiliar with Adobe's design system
  • Less flexibility for customization compared to FAST's more modular approach

Code Comparison

Spectrum Web Components:

<sp-button variant="primary">Click me</sp-button>

FAST:

<fast-button appearance="accent">Click me</fast-button>

Both libraries offer similar component usage, but with different naming conventions and attribute names. Spectrum Web Components follows Adobe's design language more closely, while FAST provides a more generic approach.

Key Differences

  • Design Philosophy: Spectrum is tightly coupled with Adobe's design system, while FAST offers a more flexible foundation for custom design systems.
  • Performance: FAST generally has a smaller footprint and better performance due to its lightweight core.
  • Ecosystem: Spectrum integrates well with Adobe products, while FAST is more versatile for various project types.
  • Customization: FAST provides more granular control over component styling and behavior, whereas Spectrum adheres more strictly to Adobe's design guidelines.

A powerful cross-platform UI toolkit for building native-quality iOS, Android, and Progressive Web Apps with HTML, CSS, and JavaScript.

Pros of Ionic Framework

  • More mature and established framework with a larger community and ecosystem
  • Supports multiple platforms (iOS, Android, web) with a single codebase
  • Offers a comprehensive set of pre-built UI components and native device features

Cons of Ionic Framework

  • Steeper learning curve, especially for developers new to Angular or other supported frameworks
  • Performance can be slower compared to native apps, particularly for complex applications
  • Larger bundle sizes due to the inclusion of multiple frameworks and components

Code Comparison

Ionic Framework:

import { Component } from '@angular/core';

@Component({
  selector: 'app-home',
  template: '<ion-button>Click me</ion-button>'
})
export class HomePage {}

FAST:

import { FASTElement, customElement, html } from '@microsoft/fast-element';

@customElement({
  name: 'app-home',
  template: html<HomePage>`<fast-button>Click me</fast-button>`
})
export class HomePage extends FASTElement {}

Both frameworks provide component-based architectures, but Ionic Framework is more tightly integrated with Angular (or other supported frameworks), while FAST offers a more lightweight and flexible approach using web components.

Modular and customizable Material Design UI components for the web

Pros of Material Components Web

  • Extensive documentation and well-established design system
  • Larger community and ecosystem with more third-party resources
  • Comprehensive set of pre-built components adhering to Material Design

Cons of Material Components Web

  • Heavier bundle size due to more comprehensive feature set
  • Less flexibility for customization outside of Material Design principles
  • Steeper learning curve for developers new to Material Design

Code Comparison

Material Components Web:

import {MDCRipple} from '@material/ripple';

const buttonRipple = new MDCRipple(document.querySelector('.mdc-button'));

FAST:

import { FASTButton } from "@microsoft/fast-components";

FASTButton;

Key Differences

  • FAST focuses on performance and flexibility, while Material Components Web prioritizes adherence to Material Design
  • FAST uses Web Components, making it more framework-agnostic
  • Material Components Web offers a more complete set of pre-built components
  • FAST provides more customization options and a lighter weight foundation

Both libraries have their strengths, with FAST being more suitable for custom designs and performance-critical applications, while Material Components Web excels in projects that want to closely follow Material Design guidelines.

12,566

A collection of professionally designed, every day UI components built on Web standards. SHOELACE IS BECOMING WEB AWESOME 👇👇👇

Pros of Shoelace

  • Lightweight and focused solely on web components, making it easier to integrate into existing projects
  • Extensive documentation with interactive examples for each component
  • Customizable through CSS custom properties, offering flexibility without complex theming systems

Cons of Shoelace

  • Smaller ecosystem and community compared to FAST
  • Less comprehensive set of components and utilities
  • Limited framework-specific integrations and tooling

Code Comparison

Shoelace button component:

<sl-button>Click me</sl-button>

FAST button component:

<fast-button>Click me</fast-button>

Both libraries use a similar approach for defining web components, but FAST offers more advanced features and customization options through its design system integration.

Summary

Shoelace is a lightweight, easy-to-use web component library with excellent documentation and straightforward customization. It's ideal for projects that need a simple set of components without the overhead of a full design system.

FAST, on the other hand, provides a more comprehensive ecosystem with advanced features, design system integration, and a larger set of components. It's better suited for large-scale applications or projects that require extensive customization and consistency across multiple platforms.

Choose Shoelace for simplicity and ease of use, or FAST for a more robust and feature-rich development experience.

A suite of polyfills supporting the HTML Web Components specs

Pros of webcomponentsjs

  • Focused solely on polyfills for Web Components, ensuring broad browser compatibility
  • Lightweight and modular, allowing developers to load only necessary polyfills
  • Widely adopted and maintained by the Web Components community

Cons of webcomponentsjs

  • Limited to polyfills, lacking a comprehensive UI component library
  • Requires more manual work to create custom elements and design systems
  • Less opinionated, potentially leading to inconsistent implementations across projects

Code Comparison

webcomponentsjs:

import '@webcomponents/webcomponentsjs/webcomponents-loader.js';

class MyElement extends HTMLElement {
  connectedCallback() {
    this.innerHTML = '<p>Hello, Web Components!</p>';
  }
}
customElements.define('my-element', MyElement);

FAST:

import { FASTElement, html, css } from '@microsoft/fast-element';

export class MyElement extends FASTElement {
  static definition = {
    name: 'my-element',
    template: html`<p>Hello, FAST!</p>`,
    styles: css`p { color: blue; }`
  };
}

Summary

webcomponentsjs focuses on providing essential polyfills for Web Components, ensuring broad browser support. It's lightweight and modular but requires more manual work to create custom elements. FAST, on the other hand, offers a comprehensive UI framework with pre-built components and design system tools, making it easier to create consistent, performant web applications. The choice between them depends on project requirements and the level of abstraction desired.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

fast_banner_github_914.png

FAST

License: MIT TypeScript code style: prettier

Maintainability Test Coverage Validate PRs Validate Platforms/Browsers

Deploy Documentation Deploy CDN

Discord Twitter

:star: We appreciate your star, it helps!

Introduction

FAST is dedicated to providing support for native Web Components and modern Web Standards, and it's designed to help you efficiently tackle some of the most common challenges in website and application design and development.

TL;DR

  • Create reusable UI components with @microsoft/fast-element, all based on W3C Web Component standards.
  • Integrate FAST Web Components with any library, framework, or build system. You can adopt incrementally without re-writing your existing systems.

For an in-depth explanation of FAST see our docs introduction.

Packages

@microsoft/fast-element

License: MIT npm version

The @microsoft/fast-element library is a lightweight means to easily build performant, memory-efficient, standards-compliant Web Components. FAST Elements work in every major browser and can be used in combination with any front-end framework or even without a framework. To get up and running with @microsoft/fast-element see the Getting Started guide.

@fluentui/web-components

License: MIT npm version

@fluentui/web-components is a library of Web Components based on the Fluent design language, built with @microsoft/fast-element.

The source for @fluentui/web-components is hosted in the Fluent UI monorepo.

Getting Started

We hope you're excited by the possibilities that FAST presents. But, you may be wondering where to start. Here are a few statements that describe various members of our community. We recommend that you pick the statement you most identify with and follow the links where they lead. You can always come back and explore another topic at any time.

Joining the Community

Looking to get answers to questions or engage with us in realtime? Our community is most active on Discord. Submit requests and issues on GitHub, or join us by contributing on some good first issues via GitHub.

Get started here with the Contributor Guide.

We look forward to building an amazing open source community with you!

Contact

  • Join the community and chat with us in real-time on Discord.
  • Submit requests and issues on GitHub.
  • Contribute by helping out on some of our recommended first issues on GitHub.

NPM DownloadsLast 30 Days