Getting startedComponentsDesign tokensThemingTheme synthesizerFrameworksAccessibilityUtilitiesServer renderingBrowser supportContributingChangelogApp ShellAspect GridAuth ShellCenterContainerDashboard GridFloat BarInsetMasonryPage HeaderPage LayoutResizableResponsive SwitcherSectionSettings LayoutSplit PaneStatus BarStickyToolbarAnchor NavBottom NavBreadcrumbBreadcrumb MenuCommand BarDrawerFooterLinkMenubarNavigation MenuPage IndicatorPaginationRailScroll IndicatorScroll SpyScroll To TopSidebarSkip LinkStepper NavTabsTop BarTree ViewAccordionAspect RatioAvatarAvatar GroupCardCarouselCollapsibleColor SwatchCTA BannerDividerEmpty StateFeature CardIconImageImage CompareImage HotspotsInfinite ScrollLightboxMarqueeQR CodeScroll AreaSkeletonSpinnerStackVideoVirtual ListActivity HeatmapAnimated NumberBadgeBar ListChartClockComparisonCountdown TimerData GridDescription ListDiffGaugeJSON TreeKanbanLevel MeterListMeterSparklineStatStepperTagTimelineUptimeValue CardWaveformBlockquoteCode BlockCode GroupGradient TextHighlightKbdKeyboard MapMarkdownNumber FormatProseTerminalTextTime AgoTruncateTypewriterButtonButton GroupCalendarCheckboxChipColor PickerComboboxCopy ButtonDate PickerDate Range PickerField ListFieldsetFile UploadFormHotkeyIcon ButtonImage CropperInline EditInputInput GroupKnobLabelMasked InputMulti SelectNumber InputPassword InputPin InputRadio GroupRange SliderRatingSearchSegmented ControlSelectSignature PadSliderSortable ListSwitch GroupTag InputTextareaTheme ToggleTime PickerToggleTransfer ListTree SelectAlertAnnouncementBannerCommand PaletteConfirmConnection StatusContext MenuConversationDialogDropdown MenuHover CardLoading OverlayNotification PanelPopoverProgressSheetToastTooltip
ARC UIARC Radiant Components
v4.9DocsComponentsTokensSynthesizer
Getting startedFrameworksServer renderingDesign tokensThemingTheme synthesizerTypographyUtilitiesAll componentsAccessibilityBrowser supportChangelogContributingStatsApp ShellAspect GridAuth ShellCenterContainerDashboard GridFloat BarInsetMasonryPage HeaderPage LayoutResizableResponsive SwitcherSectionSettings LayoutSplit PaneStatus BarStickyToolbarAnchor NavBottom NavBreadcrumbBreadcrumb MenuCommand BarDrawerFooterLinkMenubarNavigation MenuPage IndicatorPaginationRailScroll IndicatorScroll SpyScroll To TopSidebarSkip LinkStepper NavTabsTop BarTree ViewAccordionAspect RatioAvatarAvatar GroupCardCarouselCollapsibleColor SwatchCTA BannerDividerEmpty StateFeature CardIconImageImage CompareImage HotspotsInfinite ScrollLightboxMarqueeQR CodeScroll AreaSkeletonSpinnerStackVideoVirtual ListActivity HeatmapAnimated NumberBadgeBar ListChartClockComparisonCountdown TimerData GridDescription ListDiffGaugeJSON TreeKanbanLevel MeterListMeterSparklineStatStepperTagTimelineUptimeValue CardWaveformBlockquoteCode BlockCode GroupGradient TextHighlightKbdKeyboard MapMarkdownNumber FormatProseTerminalTextTime AgoTruncateTypewriterButtonButton GroupCalendarCheckboxChipColor PickerComboboxCopy ButtonDate PickerDate Range PickerField ListFieldsetFile UploadFormHotkeyIcon ButtonImage CropperInline EditInputInput GroupKnobLabelMasked InputMulti SelectNumber InputPassword InputPin InputRadio GroupRange SliderRatingSearchSegmented ControlSelectSignature PadSliderSortable ListSwitch GroupTag InputTextareaTheme ToggleTime PickerToggleTransfer ListTree SelectAlertAnnouncementBannerCommand PaletteConfirmConnection StatusContext MenuConversationDialogDropdown MenuHover CardLoading OverlayNotification PanelPopoverProgressSheetToastTooltip

Knob

A rotary knob you drag up or down to set a number, like a gain or volume control on a synth.

ComponentsKnob
inputinteractive
<arc-knob>

Overview

Knob is a rotary control that fits a full parameter range into a small circle, so a rack of channel strips or a synth panel can put a dozen side by side. A 270-degree arc fills from `min` to the current value, a glowing line marks the position, and the readout below uses tabular monospace digits so its width doesn't change as you turn. It works like the knobs in audio software. Drag vertically to turn it: the full range takes about 150 pixels of travel, and holding Shift slows the drag to a tenth. The mouse wheel and arrow keys move by `step`, Page Up and Page Down by ten steps, and Home and End go to `min` and `max`. `detents` lists values to snap to. Each gets a tick mark around the dial, and a drag snaps to one when it comes within 2.5% of the range. The wheel and keys ignore detents. `arc-input` fires on every change while the knob turns. `arc-change` fires when a drag is released and after each wheel notch or key step, so a live preview and an expensive save can listen separately.

Guidelines

Do

  • Use it where horizontal space is short and controls stack in columns: mixer strips, effect panels, tool palettes
  • Give it a `label`. A bare dial doesn't say what it controls
  • Set `format` to include the unit, so the readout and screen readers say "440 Hz" and not "440"
  • Put a detent at the neutral point of a two-sided parameter: 0 on a pan knob, unity on a gain knob

Don't

  • Don't use a knob for a single value in a wide layout. A slider shows its whole range at a size a knob can't
  • Don't use it for exact numbers. Pair it with Number Input, or use Number Input alone, when people need to type a value
  • Don't put a detent every few units. Smooth dragging becomes impossible
  • Don't hide the readout. It's part of the control

Features

  • Pointer capture keeps a drag going when the pointer leaves the dial
  • `format` shapes both the readout and the accessible value text
  • Takes part in forms through ElementInternals. The value submits under `name` and is restored on `form.reset()`
  • Keyboard-operable `role="slider"` with `aria-valuemin`, `aria-valuemax`, `aria-valuenow` and `aria-valuetext`

Preview

Usage

Knob is in the media group, so the default @arclux/arc-ui entry point doesn't include it. Import it from@arclux/arc-ui/media or from its own subpath,@arclux/arc-ui/knob.

This component needs JavaScript. Use the Web Component or a framework wrapper.

<script type="module" src="@arclux/arc-ui"></script>

<!-- Basic labeled knob -->
<arc-knob label="Volume" value="75" min="0" max="100"></arc-knob>

<!-- Bipolar pan knob with a centre detent -->
<arc-knob label="Pan" value="0" min="-50" max="50" detents="0"></arc-knob>

<!-- Filter cutoff with a formatted readout -->
<arc-knob id="cutoff" label="Cutoff" value="8000" min="200" max="16000" step="100"></arc-knob>

<!-- Disabled state -->
<arc-knob label="Locked" value="30" disabled></arc-knob>

<script>
  const cutoff = document.getElementById('cutoff');
  cutoff.format = (v) => v >= 1000 ? (v / 1000).toFixed(1) + ' kHz' : v + ' Hz';

  // Real-time preview while turning
  cutoff.addEventListener('arc-input', (e) => {
    filterNode.frequency.value = e.detail.value;
  });

  // Commit final value on release
  cutoff.addEventListener('arc-change', (e) => {
    savePatch({ cutoff: e.detail.value });
  });
</script>

API

SWEEPnumber270
Degrees of arc the knob sweeps; the remaining 90 stay open at the bottom.
DRAG_THROWnumber150
Pixels of vertical drag that cover the full range.
DETENT_WINDOWnumber0.025
Fraction of the range within which a drag snaps to a detent.
valuenumber0
Current knob value. Reflected as an attribute and updated on user interaction.
namestring''
disabledbooleanfalse
Disables interaction, reducing opacity and blocking pointer events.
labelstring''
Label text displayed above the knob in the label typography role.
formatFunctionundefined
(value) => string shaping the readout and the accessible value text, for example adding a unit suffix. Defaults to the plain number.
minnumber0
Minimum allowed value at the start of the arc sweep.
maxnumber100
Maximum allowed value at the end of the arc sweep.
stepnumber1
Increment granularity. The value snaps to multiples of this number.
detentsnumber[][]
Snap values, as an array from script or a comma-separated attribute (for example "0,50,100"). While dragging, the value snaps magnetically to a detent within 2.5% of the range, and each detent renders as a tick mark around the dial. Keyboard and wheel stepping ignore detents.
readonlybooleanfalse
Prevents dragging, wheel, and key changes while the dial stays focusable and the value still submits.
size'sm' | 'md' | 'lg''md'
Control size. md is the default; sm and lg scale the dial.
formAssociatedbooleantrue
propertiesobject{ // flag(), unlike `disabled`. The exclusion in props.js is specifically // about form-associated *platform* semantics: a `disabled` content // attribute that is merely present makes the element actually disabled // per the HTML spec, and formDisabledCallback assigns the property back, // so no converter can win. Neither of these is platform-mapped: // `required` is enforced by _computeValidity() below and `readonly` by // each component's own interaction handlers, so the stock converter buys // nothing here and costs the usual bug: `required="false"` read as true, // blocking submission of a form the author meant to leave optional. // Finding #48's shape, across all 26 form controls at once. required: flag(false), readonly: flag(false), }
Lit merges static properties up the prototype chain, so every consumer gets these without declaring them. required participates in constraint validation below; readonly reflects for styling and is enforced by each component's interaction handlers (the mixin can't know which gestures mutate state).
autoValidatesbooleantrue
Components that run their own constraint-validation logic (pattern checks, range checks) opt out of the automatic required sync by overriding this to false, and own the whole validity flag set instead.
form
validity
validationMessage
requiredbooleanfalse

Methods

checkValidity()boolean
Whether the control currently satisfies its constraints, per the native constraint-validation API. Fires invalid on the element when it does not, and reports nothing to the user.
reportValidity()boolean
As checkValidity(), but also shows the browser's validation message against the control when it fails.

Events

arc-inputdetail:{ value: number }
Fired continuously while the knob is turning: every drag movement, wheel notch, or key step. Use for real-time preview such as a filter cutoff or gain applied live.
arc-changedetail:{ value: number }
Fired once when a turn commits: on drag release, and after each discrete wheel or key step. Use for persisting the value or triggering an expensive operation.

See also