LLM-friendly URL

Item Slot Drop

Introduction

Every chart type has one or more slots -- the data dimensions that define it, such as "measure", "x-axis", or "legend". luzmo-item-slot-drop is a drop target for a single slot. Users fill it by dragging a luzmo-data-field (or a field from luzmo-data-field-panel ) onto it.

Use this component when you want to position individual slot targets yourself. If you prefer to render all slots for a chart type at once, use luzmo-item-slot-drop-panel instead.

Use the <luzmo-item-slot-drop> element in your HTML.

Interactive example

Data fields (individual)<luzmo-data-field>
Chart slots (individual)<luzmo-item-slot-drop>
Live bar chart<luzmo-viz-item>

Properties

Use HTML attributes for primitive values in markup, and JS properties for objects, arrays, and programmatic updates.

Property HTML attribute Type Description
apiUrlapi-urlstring | undefined Luzmo API URL used for linked-datasets resolution. Default: https://api.luzmo.com .
authKeyauth-keystring | undefined Auth key used by the data broker.
authTokenauth-tokenstring | undefined Auth token used by the data broker.
dragBoundarydrag-boundarystring | undefined CSS selector used as boundary when menu="draggable" .
hideConfigurationhide-configurationboolean | undefined Hides the slot menu (cog) control.
hideDeletehide-deleteboolean | undefined Hides the "clear slot" control.
itemTypeitem-typeVizItemType Chart type used to load the slot configuration (for example bar-chart ).
labellabelstring | undefined Optional label override for the rendered slot label.
languagelanguagestring UI language (labels inside the slot menu, tooltips). Default: en .
menumenu'default' | 'draggable' | 'event-only' How the slot menu behaves. Default: default .
placementplacementPlacement Slot menu placement. Default: bottom-end .
rotaterotateboolean Rotate the slot by 90 degrees (useful for side-axis slots in positioned layouts). Default: false .
sizesize's' | 'm' | 'l' | 'xl' Size variant.
slotConfigurationSlotConfiguration Optional explicit slot configuration (overrides the config loaded from itemType ).
slotNameslot-nameSlotName Slot identifier within the item type (for example measure ).
slotsContentsVizItemSlots The full slots state for the item. The component reads its own slotName content from this array.

Events

Name Payload type Description
luzmo-slot-contents-changedCustomEvent<SlotContentsChangedEventDetail> Fired when the slot contents change. Cancelable; call event.preventDefault() to reject the change. Detail shape: { slotContents: GenericSlotContent[]; linkedDatasetsIds: string[] } .
luzmo-info-visibility-changedCustomEvent<InfoVisibilityChangedEventDetail> Fired when the info toggle changes in display settings. Detail shape: { isVisible: boolean; slotContent: GenericSlotContent } .
luzmo-slot-menu-activeCustomEvent<SlotMenuActiveEventDetail> Fired when the slot menu opens. Detail shape: { datasetId: string } .
luzmo-slot-menu-highlightCustomEvent<SlotMenuHighlightEventDetail> Fired to highlight a connected data field (for example in luzmo-data-field-panel ). Detail shape: { datasetId: string; level: number; columnId?: string; formulaId?: string } .
luzmo-slot-menu-inactiveCustomEvent<void> Fired when the slot menu closes.

Event detail types are exported from @luzmo/analytics-components-kit/types .

Types

Import the component entrypoint for the element registration. SlotConfig is the only component-owned type; all other useful types come from the shared types barrel.

ts
import '@luzmo/analytics-components-kit/item-slot-drop';

import type { SlotConfig, SlotContentsChangedEventDetail } from '@luzmo/analytics-components-kit/item-slot-drop';
import type {
  InfoVisibilityChangedEventDetail,
  Placement,
  SlotContent,
  SlotMenuActiveEventDetail,
  SlotMenuHighlightEventDetail,
  SlotName,
  VizItemSlot,
  VizItemType
} from '@luzmo/analytics-components-kit/types';
Type Import path Description
SlotConfig@luzmo/analytics-components-kit/item-slot-drop Shape for a custom slotConfiguration when you override the config loaded from itemType .
SlotContentsChangedEventDetail@luzmo/analytics-components-kit/item-slot-drop Event detail for luzmo-slot-contents-changed . Shape: { slotContents: GenericSlotContent[]; linkedDatasetsIds: string[] } .
InfoVisibilityChangedEventDetail@luzmo/analytics-components-kit/types Event detail for luzmo-info-visibility-changed . Shape: { isVisible: boolean; slotContent: GenericSlotContent } .
SlotMenuActiveEventDetail@luzmo/analytics-components-kit/types Event detail for luzmo-slot-menu-active . Shape: { datasetId: string } .
SlotMenuHighlightEventDetail@luzmo/analytics-components-kit/types Event detail for luzmo-slot-menu-highlight . Shape: { datasetId: string; level: number; columnId?: string; formulaId?: string } .
VizItemSlot@luzmo/analytics-components-kit/types Element of the slotsContents array. Describes one slot's name and content.
SlotContent@luzmo/analytics-components-kit/types Shape of a single content entry inside a slot.
SlotName@luzmo/analytics-components-kit/types String literal union of valid slot identifiers (e.g. measure , x-axis ).
VizItemType@luzmo/analytics-components-kit/types String literal union of supported chart types (e.g. bar-chart , line-chart ).
Placement@luzmo/analytics-components-kit/types Popover/overlay placement values (e.g. bottom-end , right-start ).

CSS Variables

All CSS variables in this list can be set on luzmo-item-slot-drop { ... } .

Variable Description
--luzmo-item-slot-drop-font-family Font family used by the slot.
--luzmo-item-slot-drop-height Slot height.
--luzmo-item-slot-drop-border-width Border width in the empty state.
--luzmo-item-slot-drop-border-style Border style in the empty state.
--luzmo-item-slot-drop-border-color Border color in the empty state.
--luzmo-item-slot-drop-border-radius Border radius of the slot container.
--luzmo-item-slot-drop-background-color Background color in the empty state.
--luzmo-item-slot-drop-font-color Text color in the empty state.
--luzmo-item-slot-drop-edge-to-label Padding from the leading edge to the label.
--luzmo-item-slot-drop-label-to-controls Padding from the label to the controls area.
--luzmo-item-slot-drop-text-to-controls Margin between label text and controls.
--luzmo-item-slot-drop-label-font-size Label font size.
--luzmo-item-slot-drop-label-padding-top Label padding-top.
--luzmo-item-slot-drop-label-padding-bottom Label padding-bottom.
--luzmo-item-slot-drop-label-max-width Max width of the label before ellipsis.
--luzmo-item-slot-drop-controls-gap Gap between controls.
--luzmo-item-slot-drop-controls-horizontal-padding Horizontal padding for the controls container.
--luzmo-item-slot-drop-controls-control-horizontal-padding Horizontal padding for each control button.
--luzmo-item-slot-drop-controls-to-edge Margin between controls and trailing edge.
--luzmo-item-slot-drop-controls-background-color Controls background color (filled state).
--luzmo-item-slot-drop-controls-color Controls icon color (filled state).
--luzmo-item-slot-drop-controls-font-size Controls font size.
--luzmo-item-slot-drop-filled-background-color Background color when the slot is filled.
--luzmo-item-slot-drop-filled-color Text/icon color when the slot is filled.
--luzmo-item-slot-drop-filled-border-width Border width when filled.
--luzmo-item-slot-drop-filled-border-style Border style when filled.
--luzmo-item-slot-drop-filled-border-color Border color when filled.
--luzmo-item-slot-drop-filled-gap Gap between label and controls when filled.
--luzmo-item-slot-drop-accept-drag-background-color Background color while a compatible item is over the slot ( accept-drag ).
--luzmo-item-slot-drop-accept-drag-font-color Text/icon color while a compatible item is over the slot.
--luzmo-item-slot-drop-accept-drag-border-color Border color while a compatible item is over the slot.
--luzmo-item-slot-drop-accept-drag-controls-background-color Controls background color while a compatible item is over the slot.
--luzmo-item-slot-drop-accept-drag-controls-color Controls icon color while a compatible item is over the slot.
--luzmo-item-slot-drop-pulse-color Pulse animation color used while dragging over the slot.
--luzmo-item-slot-drop-background-color-disabled Background color when the disabled attribute is present.
--luzmo-item-slot-drop-color-disabled Text/icon color when the disabled attribute is present.
--luzmo-item-slot-drop-overlay-horizontal-gap Horizontal margin around the slot menu overlay (left/right placements).
--luzmo-item-slot-drop-overlay-vertical-gap Vertical margin around the slot menu overlay (top/bottom placements).
--luzmo-slot-would-accept-drop-animation Animation applied when a compatible drag is in progress ( would-accept-drag ).

Code examples

index.html
Web component
Angular
React
React Native
Vue
<luzmo-item-slot-drop
  id="measureSlot"
  item-type="bar-chart"
  slot-name="measure"
  label="Measure"
  language="en"
  size="m"
  api-url="https://api.luzmo.com"
  auth-key="your-auth-key"
  auth-token="your-auth-token"
></luzmo-item-slot-drop>

<script type="module">
  import '@luzmo/analytics-components-kit/item-slot-drop';

  let slotsContents = [
    {
      name: 'measure',
      content: [
        {
          datasetId: '6f2f9f80-3d80-4f45-9d5c-6d1b2e4a8c11',
          columnId: '2a7c5e41-6d8f-4b2a-93c1-7e5d4f6a8b12',
          label: { en: 'Revenue' },
          type: 'numeric',
          aggregationFunc: 'sum'
        }
      ]
    }
  ];

  const measureSlot = document.getElementById('measureSlot');

  measureSlot.slotsContents = slotsContents;

  measureSlot.addEventListener('luzmo-slot-contents-changed', (event) => {
    slotsContents = [{ name: 'measure', content: event.detail.slotContents }];
    measureSlot.slotsContents = slotsContents;
  });
</script>
Did this page help you?
Yes No