# @microsoft/fast-foundation

> A library of Web Component building blocks

Latest version **2.50.0** (published 2024-10-23) · MIT license · 0 weekly downloads

## Install

```sh
npm install @microsoft/fast-foundation
pnpm add @microsoft/fast-foundation
yarn add @microsoft/fast-foundation
bun add @microsoft/fast-foundation
```

## Health

**Score 55/100 (C)** — status: stable.

Positive: has types; esm support; no vulnerabilities; high maintenance score; high quality score.

Warnings: low downloads.

Negative: stale.

## Facts

| | |
|---|---|
| Version | 2.50.0 |
| Published | 2024-10-23 |
| First published | 2020-05-15 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 4 |
| Unpacked size | 4.1 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 9671 |
| Author | Microsoft |
| Maintainers | awentzel, chrisdholt, nirice, eisenbergeffect, microsoft1es, fastsvc, janechu |

## Links

- npm: https://www.npmjs.com/package/@microsoft/fast-foundation
- Repository: https://github.com/Microsoft/fast
- Homepage: https://github.com/Microsoft/fast#readme
- Issues: https://github.com/Microsoft/fast/issues/new/choose
- npm.io page: https://npm.io/package/@microsoft/fast-foundation

## Dependencies (4)

- [tslib](https://npm.io/package/tslib.md) ^1.13.0
- [tabbable](https://npm.io/package/tabbable.md) ^5.2.0
- [@microsoft/fast-element](https://npm.io/package/@microsoft/fast-element.md) ^1.14.0
- [@microsoft/fast-web-utilities](https://npm.io/package/@microsoft/fast-web-utilities.md) ^5.4.1

## Recent versions

- 2.50.0 (latest) — 2024-10-23
- 3.0.0-alpha.33 (alpha) — 2024-06-20
- 3.0.0-alpha.1 (beta) — 2022-06-01
- 2.49.6 — 2024-04-08
- 2.49.5 — 2024-01-23
- 3.0.0-alpha.32 — 2023-12-20
- 2.49.4 — 2023-11-09
- 2.49.3 — 2023-11-01
- 2.49.2 — 2023-10-11
- 3.0.0-alpha.31 — 2023-08-18
- 3.0.0-alpha.30 — 2023-08-18
- 3.0.0-alpha.29 — 2023-08-12
- 2.49.1 — 2023-08-11
- 3.0.0-alpha.28 — 2023-06-16
- 2.49.0 — 2023-05-04
- … 182 more at https://npm.io/package/@microsoft/fast-foundation/versions

## README

# FAST Foundation

[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![npm version](https://badge.fury.io/js/%40microsoft%2Ffast-foundation.svg)](https://badge.fury.io/js/%40microsoft%2Ffast-foundation)

The `fast-foundation` package is a library of Web Component classes, templates, and other utilities intended to be composed into registered Web Components by design systems (e.g. Fluent Design, Material Design, etc.). The exports of this package can generally be thought of as un-styled base components that implement semantic and accessible markup and behavior.

This package does not export Web Components registered as [custom elements](https://developer.mozilla.org/en-US/docs/Web/Web_Components/Using_custom_elements) - it exports parts and pieces intended to be *composed* into Web Components, allowing you to implement your own design language by simply applying CSS styles and behaviors without having to write all the JavaScript that's involved in building production-quality component implementations.

## Installation

### From NPM

To install the `fast-foundation` library, use either `npm` or `yarn` as follows:

```shell
npm install --save @microsoft/fast-foundation
```

```shell
yarn add @microsoft/fast-foundation
```

Within your JavaScript or TypeScript code, you can then import library APIs like this:

```ts
import { Anchor } from '@microsoft/fast-foundation';
```

Looking for a setup that integrates with a particular front-end framework or bundler? Check out [our integration docs](https://fast.design/docs/integrations/introduction).

### From CDN

A pre-bundled script that contains all APIs needed to use FAST Foundation is available on CDN. You can use this script by adding [`type="module"`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules) to the script element and then importing from the CDN.

```html
<!DOCTYPE html>
<html lang="en">
    <head>
        <script type="module">
          import { Anchor } from "https://cdn.jsdelivr.net/npm/@microsoft/fast-foundation/dist/fast-foundation.min.js";

          // your code here
        </script>
    </head>
    <!-- ... -->
</html>
```

The markup above always references the latest release. When deploying to production, you will want to ship with a specific version. Here's an example of the markup for that:

```html
<script type="module" src="https://cdn.jsdelivr.net/npm/@microsoft/fast-foundation@2.26.2/dist/fast-foundation.min.js"></script>
```

:::note
For simplicity, examples throughout the documentation will assume the library has been installed from NPM, but you can always replace the import location with the CDN URL.
:::

---
_Source: https://npm.io/package/@microsoft/fast-foundation · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
