Skip to content

Potentiometer

Class: FxPotentiometer · Tag: <fx-potentiometer> · Mixins: Animatable

The <fx-potentiometer> component is a high-precision, tactile rotary knob designed for industrial system dials, tuning controls, and fine calibration equipment.


Register the component by importing it directly in your application entrypoint:

import '@salsafx/ui';

Interactive preview of the main variants:


Click and drag the metallic knob below to rotate it! Supports multi-touch inputs and fine dial precision.

<fx-potentiometer
value="40"
min="0"
max="100"
label="Volume"
unit="%"
style="--fx-potentiometer-size: 220px;"
></fx-potentiometer>
<fx-potentiometer
value="35"
min="0"
max="100"
ticks="9"
snap-to-ticks
label="Frequency Tune"
unit="MHz"
style="
--fx-potentiometer-size: 200px;
--fx-potentiometer-theme-color: #10b981;
"
>
<fx-radial-scale
slot="scale"
value="35"
min="0"
max="100"
count="8"
sub-divisions="5"
start-angle="-135"
arc-length="270"
has-scale-labels
></fx-radial-scale>
</fx-potentiometer>
<fx-potentiometer
value="6"
min="0"
max="10"
ticks="11"
snap-to-ticks
label="Drive"
style="
--fx-potentiometer-size: 220px;
--fx-potentiometer-theme-color: #f59e0b;
"
>
<fx-metalic-knob slot="knob"></fx-metalic-knob>
</fx-potentiometer>

PropertyAttributeTypeDefaultDescription
valuevalueNumber0Current value.
minminNumber0Minimum value.
maxmaxNumber100Maximum value.
startAnglestart-angleNumber-135Starting rotation limit in degrees (0 is top/12 o’clock).
arcLengtharc-lengthNumber270Total sweep degrees of rotation from start to end bounds.
isAnimatedis-animatedBooleantrueEnables fluid, hardware-accelerated transitions when the value updates.
disableddisabledBooleanfalseDisables the control and prevents user interaction.
hasScaleLabelshas-scale-labelsBooleantrueShows numeric labels on major ticks.
ticksticksNumber0Number of major ticks.
snapToTickssnap-to-ticksBooleanfalseSnaps the knob to major ticks.
hasValueDisplayhas-value-displayBooleanfalseShows the value display below the knob.
labellabelString""Text identifier label.
unitunitString""Measurement unit description.
NameDescription
knobCenter dial knob. Defaults to <fx-knob>. Pass a custom element (e.g. <fx-metalic-knob>) with slot="knob" to replace it.
scaleOverrides calibration markers. Expects <fx-radial-simple-scale>.
displayOverrides bottom value panel. Expects <fx-value-display>.
NameDetailDescription
input{ value: Number }Emitted continuously as the knob is rotated.
change{ value: Number }Emitted once when dragging is released.
PropertyDefaultDescription
--fx-potentiometer-size220pxOuter dial diameter width and height.
--fx-potentiometer-bezel-fill#1e293bOuter bezel / plate fill.
--fx-potentiometer-bezel-stroke#334155Outer bezel outline color.
--fx-potentiometer-track-color#0f172aInactive rotational track background color.
--fx-potentiometer-theme-color#06b6d4Default knob pointer accent (and legacy fill accent).
--fx-potentiometer-gradient-start#06b6d4Active arc gradient start.
--fx-potentiometer-gradient-middle#6366f1Active arc gradient middle.
--fx-potentiometer-gradient-end#a855f7Active arc gradient end.
--fx-knob#1e293bDefault <fx-knob> fill.
--fx-knob-ring#334155Default <fx-knob> stroke.
--fx-knob-pointertheme colorDefault <fx-knob> pointer tick.
--fx-radial-scale-color#475569Tick mark stroke color.
--fx-radial-scale-label-color#64748bTick number label color.

classDiagram
    direction TB
    class FxElement
    class FxMeasureElement
    class FxPotentiometer

    FxElement <|-- FxMeasureElement
    FxMeasureElement <|-- FxPotentiometer : Animatable

See also Architecture.