LLM-friendly URL

Item Slot Drop Panel

Introduction

luzmo-item-slot-drop-panel renders all drag-and-drop slot targets for a given chart type in one go. It automatically loads the slot configuration for the selected item-type and enforces slot constraints (rules about which fields can go where and how many are allowed).

Pair this component with luzmo-data-field-panel , which provides the draggable fields users drop into each slot. For a dropdown-based alternative that doesn't require drag-and-drop, see luzmo-item-slot-picker-panel .

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

Interactive example

Dataset fields (panel)<luzmo-data-field-panel>
Chart slots (panel)<luzmo-item-slot-drop-panel>
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.
constraintModeconstraint-mode'auto' | 'event-only' How constraints are handled. Default: auto .
contentLanguagecontent-languagestring Language used for locale-aware formatting and data labels. Default: en .
dragBoundarydrag-boundarystring | undefined Boundary selector passed to child slots for draggable menu mode.
growsgrowsboolean | undefined Makes slots stretch to full width in the default (non-positioned) layout.
hideConfigurationhide-configurationboolean Hides the slot menu (cog) control on child slots. Default: false .
hideDeletehide-deleteboolean Hides the "clear slot" control on child slots. Default: true .
itemTypeitem-typeVizItemType | string Chart type used to load slot (and optional positioning) configuration.
languagelanguagestring UI language. Default: en .
positionedpositionedboolean Enables grid-based slot positioning. Default: false .
positioningConfiguration — SlotPositioningConfig | undefined Optional explicit positioning configuration (only used when positioned is set).
sizesize's' | 'm' | 'l' | 'xl' Size variant passed to child slots.
slotMenuModeslot-menu-mode'default' | 'draggable' | 'event-only' Slot menu interaction mode passed to child slots. Default: default .
slotMenuPlacementslot-menu-placementPlacement Slot menu placement passed to child slots. Default: bottom-end .
slotsConfiguration — SlotConfiguration[] | undefined Optional explicit slot configuration (overrides the config loaded from itemType ).
slotsContents — VizItemSlots The full slots state for the item. This is the source of truth for the rendered slots.

Events

Name Payload type Description
luzmo-slots-contents-changedCustomEvent<{ slotsContents: VizItemSlots; linkedDatasetsIds: string[] }> Fired when the overall slots state changes after constraints are applied.
luzmo-slot-constraint-triggeredCustomEvent<SlotConstraintTriggeredEventDetail> Fired only in constraint-mode="event-only" when the proposed change would trigger constraints. The panel blocks the change until you decide whether to apply event.detail.proposedSlotsContents .

SlotConstraintTriggeredEventDetail is exported from @luzmo/analytics-components-kit/types .

Types

This entrypoint currently has no component-owned type exports. All useful types are imported from the shared types barrel.

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

import type {
  Placement,
  SlotConfig,
  SlotConstraint,
  SlotConstraintTriggeredEventDetail,
  SlotContentsChangedEventDetail,
  SlotName,
  SlotPosition,
  SlotPositioningConfig,
  VizItemSlot,
  VizItemType
} from '@luzmo/analytics-components-kit/types';
Type Import path Description
SlotConfig@luzmo/analytics-components-kit/types Shape for entries in the slotsConfiguration array. Describes one slot's constraints, accepted types, and display settings.
SlotPositioningConfig@luzmo/analytics-components-kit/types Configuration for grid-based slot positioning (used when positioned is enabled).
SlotPosition@luzmo/analytics-components-kit/types Position of a slot inside the positioning grid.
SlotName@luzmo/analytics-components-kit/types String literal union of valid slot identifiers.
VizItemSlot@luzmo/analytics-components-kit/types Element of the slotsContents array.
VizItemType@luzmo/analytics-components-kit/types String literal union of supported chart types.
SlotConstraint@luzmo/analytics-components-kit/types Describes a constraint rule that limits which fields can go into a slot.
SlotConstraintTriggeredEventDetail@luzmo/analytics-components-kit/types Event detail for luzmo-slot-constraint-triggered . Contains proposedSlotsContents for you to accept or reject.
SlotContentsChangedEventDetail@luzmo/analytics-components-kit/types Event detail for the per-slot luzmo-slot-contents-changed event (emitted by child luzmo-item-slot-drop elements).
Placement@luzmo/analytics-components-kit/types Popover/overlay placement values.

The panel-level luzmo-slots-contents-changed event does not currently have a named exported interface. Its payload shape is CustomEvent<{ slotsContents: VizItemSlot[]; linkedDatasetsIds: string[] }> .

CSS Variables

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

Variable Description
--luzmo-item-slot-drop-panel-font-size Base font size (used when size is not set).
--luzmo-item-slot-drop-panel-font-size-s Font size for size="s" .
--luzmo-item-slot-drop-panel-font-size-l Font size for size="l" .
--luzmo-item-slot-drop-panel-font-size-xl Font size for size="xl" .
--luzmo-item-slot-drop-panel-gap Gap between slots in the default (non-positioned) layout.
--luzmo-item-slot-drop-panel-align Alignment of slots in the default (non-positioned) layout.
--luzmo-item-slot-drop-panel-min-width Minimum width when positioned is enabled and the parent has no explicit size.
--luzmo-item-slot-drop-panel-min-height Minimum height when positioned is enabled and the parent has no explicit size.
--luzmo-slot-cell-padding-inline-min Minimum horizontal padding inside slot cells (positioned layout).
--luzmo-slot-cell-padding-inline-max Maximum horizontal padding inside slot cells (positioned layout).
--luzmo-slot-cell-padding-block-min Minimum vertical padding inside slot cells (positioned layout).
--luzmo-slot-cell-padding-block-max Maximum vertical padding inside slot cells (positioned layout).

Code examples

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

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

  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 dropPanel = document.getElementById('dropPanel');

  dropPanel.slotsContents = slotsContents;

  dropPanel.addEventListener('luzmo-slots-contents-changed', (event) => {
    slotsContents = event.detail.slotsContents;
    dropPanel.slotsContents = slotsContents;
  });
</script>
Did this page help you?
Yes No