Skip to content

Card

Class: FxCard · Tag: <fx-card>

The <fx-card> component is an accent-header panel container designed for HMI dashboards. It features a top accent border, an optional title, a status badge, and an icon, with a content slot for nesting gauges, displays, or other controls.


import '@salsafx/ui';

Interactive preview of the main variants:


The accent color styles the top border, icon, and badge. Any control can be nested inside the default slot.

<fx-card
title="Rotor Speed"
badge="RPM"
icon="fa-solid fa-rotate"
accent-color="#f59e0b"
>
<fx-radial-gauge value="82" label="N1" unit="RPM"></fx-radial-gauge>
</fx-card>

Combine multiple controls (such as LEDs) with <fx-separator> inside the content slot. The spacing between elements is controlled by the card’s gap property.

<fx-card
title="System Temperatures"
badge="°C"
icon="fa-solid fa-temperature-half"
accent-color="#fb7185"
>
<fx-led-indicator label="Gearbox" color="#fb7185" is-active></fx-led-indicator>
<fx-separator thickness="thin" padding="small"></fx-separator>
<fx-led-indicator label="Coolant" color="#38bdf8" is-active></fx-led-indicator>
</fx-card>

PropertyAttributeTypeDefaultDescription
titletitleString""Optional title displayed in the card header.
badgebadgeString""Optional status or unit badge text displayed in the header.
iconiconString""Icon-font class list (e.g. "fa-solid fa-bolt") or a path ending in .svg.
accentColoraccent-colorString"#f59e0b"Color used for the top border, icon, and badge text.
badgeBackgroundbadge-backgroundString""Optional background color override for the badge.
backgroundbackgroundString"#131920"Card background color.
borderRadiusborder-radiusString"10px"Corner border radius of the card.
paddingpaddingString"20px 18px"Padding inside the card.
gapgapString"12px"Spacing gap between the header and content, and between children in the content slot.
accentWidthaccent-widthString"3px"Thickness of the top accent border.
alignXalign-xString"center"Horizontal content alignment ("left", "center", "right", "stretch").
alignYalign-yString"center"Vertical content alignment ("top", "center", "bottom", "stretch").
NameDescription
defaultCard body — gauges, LEDs, displays, etc.
iconCustom header icon (overrides the icon attribute when slotted).
PropertyDefaultDescription
--fx-font-familysans-serifFont stack for title and badge.

classDiagram
    direction TB
    class FxElement
    class FxContainerElement
    class FxContentElement
    class FxCard

    FxElement <|-- FxContainerElement
    FxContainerElement <|-- FxContentElement
    FxContentElement <|-- FxCard

See also Architecture.