Skip to content

Installation

SalsaFX is distributed as the npm package @salsafx/ui.

Release@salsafx/uiv16.62.0


  • Node.js 18 or later
  • npm, pnpm, yarn, or bun
  • A project using Lit (peer dependency) or any framework that supports Web Components

  1. Install the package

    Terminal window
    npm install @salsafx/ui

    After installation, your package.json will contain:

    {
    "dependencies": {
    "@salsafx/ui": "^4.11.0"
    }
    }
  2. Install the peer dependency

    SalsaFX requires Lit:

    Terminal window
    npm install lit

Register all components with a single import in your app entry (Vite, webpack, …):

import '@salsafx/ui';

Once imported, the components are available as standard HTML custom elements:

<fx-radial-gauge
value="75"
min="0"
max="100"
label="Oil Pressure"
unit="BAR"
></fx-radial-gauge>

SalsaFX components are standard Web Components and work in any framework:

import { LitElement, html } from 'lit';
import { customElement, property } from 'lit/decorators.js';
import '@salsafx/ui';
@customElement('my-dashboard')
export class MyDashboard extends LitElement {
@property({ type: Number }) value = 75;
render() {
return html`
<fx-radial-gauge
.value=${this.value}
min="0"
max="100"
label="Oil Pressure"
unit="BAR"
></fx-radial-gauge>
`;
}
}

Terminal window
npm update @salsafx/ui

The package includes TypeScript declarations. No additional @types package is needed.

import type { FxRadialGauge } from '@salsafx/ui';
const gauge = document.querySelector('fx-radial-gauge') as FxRadialGauge;
gauge.value = 80;

Component wrappers with typed props are exported from @salsafx/ui/react and @salsafx/ui/solid. Intrinsic JSX types for <fx-*> custom element tags are also included.