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.
<luzmo-data-field-panel><luzmo-item-slot-drop-panel><luzmo-viz-item>Use HTML attributes for primitive values in markup, and JS properties for objects, arrays, and programmatic updates.
| Property | HTML attribute | Type | Description |
|---|---|---|---|
apiUrl | api-url | string | undefined | Luzmo API URL used for linked-datasets resolution. Default: https://api.luzmo.com . |
authKey | auth-key | string | undefined | Auth key used by the data broker. |
authToken | auth-token | string | undefined | Auth token used by the data broker. |
constraintMode | constraint-mode | 'auto' | 'event-only' | How constraints are handled. Default: auto . |
contentLanguage | content-language | string | Language used for locale-aware formatting and data labels. Default: en . |
dragBoundary | drag-boundary | string | undefined | Boundary selector passed to child slots for draggable menu mode. |
grows | grows | boolean | undefined | Makes slots stretch to full width in the default (non-positioned) layout. |
hideConfiguration | hide-configuration | boolean | Hides the slot menu (cog) control on child slots. Default: false . |
hideDelete | hide-delete | boolean | Hides the "clear slot" control on child slots. Default: true . |
itemType | item-type | VizItemType | string | Chart type used to load slot (and optional positioning) configuration. |
language | language | string | UI language. Default: en . |
positioned | positioned | boolean | Enables grid-based slot positioning. Default: false . |
positioningConfiguration | — | SlotPositioningConfig | undefined | Optional explicit positioning configuration (only used when positioned is set). |
size | size | 's' | 'm' | 'l' | 'xl' | Size variant passed to child slots. |
slotMenuMode | slot-menu-mode | 'default' | 'draggable' | 'event-only' | Slot menu interaction mode passed to child slots. Default: default . |
slotMenuPlacement | slot-menu-placement | Placement | 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. |
| Name | Payload type | Description |
|---|---|---|
luzmo-slots-contents-changed | CustomEvent<{ slotsContents: VizItemSlots; linkedDatasetsIds: string[] }> | Fired when the overall slots state changes after constraints are applied. |
luzmo-slot-constraint-triggered | CustomEvent<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 .
This entrypoint currently has no component-owned type exports. All useful types are imported from the shared types barrel.
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[] }> .
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). |
<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>