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.
<luzmo-data-field><luzmo-item-slot-drop><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. |
dragBoundary | drag-boundary | string | undefined | CSS selector used as boundary when menu="draggable" . |
hideConfiguration | hide-configuration | boolean | undefined | Hides the slot menu (cog) control. |
hideDelete | hide-delete | boolean | undefined | Hides the "clear slot" control. |
itemType | item-type | VizItemType | Chart type used to load the slot configuration (for example bar-chart ). |
label | label | string | undefined | Optional label override for the rendered slot label. |
language | language | string | UI language (labels inside the slot menu, tooltips). Default: en . |
menu | menu | 'default' | 'draggable' | 'event-only' | How the slot menu behaves. Default: default . |
placement | placement | Placement | Slot menu placement. Default: bottom-end . |
rotate | rotate | boolean | Rotate the slot by 90 degrees (useful for side-axis slots in positioned layouts). Default: false . |
size | size | 's' | 'm' | 'l' | 'xl' | Size variant. |
slotConfiguration | — | SlotConfiguration | Optional explicit slot configuration (overrides the config loaded from itemType ). |
slotName | slot-name | SlotName | Slot identifier within the item type (for example measure ). |
slotsContents | — | VizItemSlots | The full slots state for the item. The component reads its own slotName content from this array. |
| Name | Payload type | Description |
|---|---|---|
luzmo-slot-contents-changed | CustomEvent<SlotContentsChangedEventDetail> | Fired when the slot contents change. Cancelable; call event.preventDefault() to reject the change. Detail shape: { slotContents: GenericSlotContent[]; linkedDatasetsIds: string[] } . |
luzmo-info-visibility-changed | CustomEvent<InfoVisibilityChangedEventDetail> | Fired when the info toggle changes in display settings. Detail shape: { isVisible: boolean; slotContent: GenericSlotContent } . |
luzmo-slot-menu-active | CustomEvent<SlotMenuActiveEventDetail> | Fired when the slot menu opens. Detail shape: { datasetId: string } . |
luzmo-slot-menu-highlight | CustomEvent<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-inactive | CustomEvent<void> | Fired when the slot menu closes. |
Event detail types are exported from @luzmo/analytics-components-kit/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.
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 ). |
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 ). |
<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>