API: Fx · Managers: FontManager, IconManager, ThemeManager
SalsaFX exposes a global Fx facade for app-wide setup. Call Fx.configure() once at startup (and again whenever you need to change settings).
import { Fx , IconPacks , Fonts , DisplayFonts , Themes } from '@salsafx/ui' ;
displayFont: DisplayFonts . Segmented ,
iconPacks: [ IconPacks . FontAwesome ],
theme: Themes . SilverBlue ,
Fx.configure is chainable and merges with the current configuration.
Member Kind Description configure(settings?)method Merge settings and apply. Returns Fx. apply()method Re-apply the current configuration. Returns Fx. use(configurator)method Register an additional configurator. Returns Fx. configurationgetter Resolved configuration after the last configure/apply. defaultsgetter Default configuration from registered managers. Fontscatalog Built-in UI faces for uiFont. DisplayFontscatalog Display style presets for displayFont. Themescatalog Named look presets for theme. IconPackscatalog Built-in icon pack URLs.
Controls the global UI face and the display / value style.
Setting Type Default Description uiFontFonts.*, catalog key, or { family, href }Fonts.ManropeFace for general chrome. displayFontDisplayFonts.*, catalog key, { family, href }, or "uiFont"DisplayFonts.SegmentedFace for digital / value typography. Use "uiFont" or DisplayFonts.Classic to mirror the UI face.
Key Source Fonts.ManropeBundled with the package Fonts.InterBundled with the package Fonts.NotoSansBundled with the package Fonts.OxaniumBundled with the package Fonts.ChakraPetchBundled with the package Fonts.DsDigitalCDN (network required)
Key Notes DisplayFonts.SegmentedClassic 7-segment digital style (default). Uses Fonts.DsDigital (CDN). DisplayFonts.ModernFuturistic, high-tech geometric style (bundled). DisplayFonts.ClassicSame face as the active UI setting.
displayFont: DisplayFonts . Segmented ,
href: 'https://example.com/my-ui.css' ,
Property Description --fx-font-familyUI font family. --fx-display-font-familyDisplay font family.
Optional icon pack stylesheets. Nothing is loaded by default.
Setting Type Default Description iconPacksstring[][]Catalog URLs (IconPacks.*) and/or custom stylesheet URLs.
Key Pack Source IconPacks.FontAwesomeFont Awesome Bundled with the package IconPacks.MaterialDesignMaterial Design Icons CDN IconPacks.MaterialSymbolsMaterial Symbols Outlined CDN IconPacks.LucideLucide CDN IconPacks.PhosphorPhosphor (regular) CDN IconPacks.TablerTabler Icons CDN
iconPacks: [ IconPacks . FontAwesome , IconPacks . MaterialDesign ],
'https://cdn.example.com/icons/my-pack.css' ,
Re-configuring iconPacks replaces the active set.
Sets the default named look for component groups, plus the default fill gradient triad. An instance can still override with its own theme attribute when supported.
Setting Type Description themepreset key, Themes.*, or settings object Named preset or partial settings. Omitted keys keep their current value. theme.componentspartial map Per-group look. theme.gradients{ start, middle, end }Default fill colors for gauges, bars, and potentiometer.
Stop Default start #06b6d4middle #6366f1end #a855f7
Property Description --fx-theme-gradient-startFill gradient start. --fx-theme-gradient-middleFill gradient middle. --fx-theme-gradient-endFill gradient end.
Preset Notes Themes.DefaultLibrary defaults. Themes.SilverBlueLighter silver shells; default fill triad. Themes.DarkGreenDark green panels; amber / orange fill.
Fx . configure ({ theme: Themes . DarkGreen });
Fx . configure ({ theme: 'SilverBlue' });
Group Looks Default FxDisplaysilver, darkbluedarkblueFxSwitchsnow, silversilverFxLinearTrackElementsilver, darkdarkFxRadialGaugesilver, darksilverFxPotentiometersilver, darksilverFxCardsilver, darkgreen, iron, dark, darkblue, darkergreen, snowironFxGroupBoxsilver, darkgreen, iron, dark, darkblue, darkergreen, snowironFxTabsdarkgreen, iron, darkergreendarkergreen
FxLinearTrackElement covers linear shells (fader, linear bar, and related linear gauges).
Look Hex silver #1e293bdarkgreen #131920iron #111827dark #080b10darkblue #0b111fdarkergreen #0c0e12snow #ffffff
< fx-card theme = "darkergreen" title = "Alarms" ></ fx-card >
< fx-display theme = "silver" label = "Temp" value = "42" ></ fx-display >
Partial theme.components and theme.gradients updates merge into the existing values.