npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@fabric-msft/fabric-web

v4.0.0

Published

The Fabric UX System represents a leap forward in design consistency and extensibility for Microsoft Fabric. Developed by the Fabric UX Team, this system is a collection of design guidance, common patterns, and reusable components created to empower desig

Readme

Fabric Web Components

The Fabric UX System represents a leap forward in design consistency and extensibility for Microsoft Fabric. Developed by the Fabric UX Team, this system is a collection of design guidance, common patterns, and reusable components created to empower designers and developers to build consistent, accessible, and engaging workload experiences across Fabric surfaces.

View the Fabric UX System documentation.

Fabric Web Components is a library that composes @microsoft/fast-foundation and supports Microsoft's Fluent design language.

Installation

Note: These packages are currently published to the PowerBIClients Azure Artifacts registry, not NPM. You'll need to configure your package manager to use the Azure Artifacts feed.

Registry Information:

  • Package: @fabric-msft/fabric-web
  • Feed: PowerBIClients at https://dev.azure.com/powerbi/Trident/_artifacts/feed/PowerBIClients

Once you've configured access to the Azure Artifacts feed, you can install the components using:

npm

npm install @fabric-msft/fabric-web

Yarn

yarn add @fabric-msft/fabric-web

After installation, the library is immediately ready for use, allowing developers to begin incorporating Fabric UI components into their web applications with minimal setup.

Configuring and Importing Components

Before diving into the specifics of component usage, it's essential to understand how to configure and import the Fabric Web Components library within your project. This step is crucial for ensuring that the components are correctly initialized and ready to be used within your application.

Initial Configuration

Upon successful installation, the next step is to configure your project to use the Fabric Web Components. This involves setting up your build toolchain to recognize and correctly process the custom elements and associated styles provided by the library. Depending on your project setup, this might require additional plugins or configuration tweaks to support web components fully.

For detailed configuration instructions, refer to this guide from MDN.

Importing Components

To use a component, import it into your JavaScript or TypeScript file as follows:

import {
  Badge,
  BadgeDefinition,
  Button,
  ButtonDefinition
} from "@fabric-msft/fabric-web";

// Define the custom elements
BadgeDefinition.define();
ButtonDefinition.define();

Using Fabric Web Components

With the components imported and defined, you can start incorporating them into your web applications. Here are some examples:

<fabric-badge shape="rounded" size="large" color="danger">
  New Feature
</fabric-badge>

<fabric-button appearance="primary">Click me</fabric-button>

<fabric-dialog>
  <div slot="heading">Dialog Title</div>
  <p>Dialog content goes here.</p>
  <div slot="footer">
    <fabric-button appearance="secondary">Cancel</fabric-button>
    <fabric-button appearance="primary">Confirm</fabric-button>
  </div>
</fabric-dialog>

Customization and Theming

Fabric Web Components are designed with customization in mind, allowing developers to apply custom themes and styles to align with their application's branding. The library supports theming through CSS custom properties, enabling a flexible approach to styling components.

To apply a theme, you can import and use the theme utilities provided by the Fabric theme library:

import { setTheme, fabricLightTheme } from "@fabric-msft/theme";

// Apply the light theme
setTheme(fabricLightTheme);

This code snippet demonstrates how to apply the Fabric light theme to your application, ensuring that the components adhere to a consistent visual style.

Understanding Custom Events in Web Components

Fabric Web Components use conventional naming for events (click, dismiss, etc). For components that use custom events, use addEventListener or inline listeners:

document
  .querySelector("fabric-stepper")
  ?.addEventListener("stepschanged", (e) => {
    console.log("Steps changed:", e.detail);
  });

document
  .querySelector("fabric-popover")
  ?.addEventListener("hidePopover", (e) => {
    console.log("Popover hidden:", e.detail);
  });

CSS Variables

Customize component appearance using component-level variables. Some web components expose CSS variables for specific styling aspects:

fabric-filter-pill {
  --icon-spacing: 8px;
}

fabric-button {
  --button-padding: 12px;
}

Slots, Attributes, and Properties

Web components support named and default slots for flexible content placement:

<fabric-dialog>
  Dialog content
  <fabric-button slot="action">Close</fabric-button>
</fabric-dialog>

Set properties via attributes:

<fabric-slider size="large"></fabric-slider>
<fabric-slider readonly></fabric-slider>

VS Code Settings

To get the best experience when using this package in VS Code, we recommend adding the following lines to your .vscode/settings.json file:

{
  "html.customData": [
    "./node_modules/@fabric-msft/fabric-web/dist/fabric-web.html.json"
  ],
  "css.customData": [
    "./node_modules/@fabric-msft/fabric-web/dist/fabric-web.css.json"
  ]
}