LLM-friendly URL

Item Option

Introduction

luzmo-item-option renders a single chart option control. Use it when you want to expose one specific setting, such as a title toggle, a chart mode picker, or a color selector, instead of showing the full options editor.

This component works well in custom chart builders, simplified configuration screens, and role-based UIs where only a few settings should be editable. It can load a built-in option by combining item-type with option-key , or render a fully custom control through customOptionConfiguration . If you want to expose all supported options for a chart type at once, use luzmo-item-option-panel instead.

Treat options as application state: listen to luzmo-options-changed , update your state, and pass the updated object back into the component. When you need to find a valid built-in option-key , inspect the exported item options config for your chart type in @luzmo/analytics-components-kit/item-options-configs .

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

Interactive example

Chart options<luzmo-item-option>
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 when fetching saved themes. 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.
customOptionConfigurationOptionConfig | undefined Custom option definition. When provided, built-in item config is not loaded.
customTranslationsOptionTranslation | TranslationOverrides | undefined Translation overrides for the rendered option. Can be a direct translation object or a flat override map keyed by option key.
itemTypeitem-typeVizItemType | string | undefined Item/chart type used to load built-in option configuration. Leave unset when customOptionConfiguration is provided.
languagelanguagestring UI language used to load option labels and translations. Default: en .
optionKeyoption-keystring | undefined Option key to render from the built-in configuration, for example display.title . Ignored when using custom config.
optionsRecord<string, unknown> | undefined Current options object edited by the component.
sizesize's' | 'm' | 'l' | 'xl' Size variant forwarded to the rendered control. Default: m .
slotsVizItemSlots | undefined Current slots state passed to the option control. Used for visibility logic and chart-specific defaults.
themeThemeConfig & Record<string, unknown> | undefined Theme object passed to the option control. Useful for theme-aware pickers and other style-related options.

Events

Name Payload type Description
luzmo-options-changedCustomEvent<{ options: Record<string, unknown> }> Fired when the option value changes. Cancelable; event bubbles and is composed for parent handling.

Types

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

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

import type {
  OptionConfig,
  OptionTranslation,
  Slot,
  ThemeConfig,
  TranslationOverrides,
  TranslationsFile,
  VizItemType
} from '@luzmo/analytics-components-kit/types';
Type Import path Description
OptionConfig@luzmo/analytics-components-kit/types Shape for a custom single-option definition passed through customOptionConfiguration . Describes the option key, control type, and default value.
OptionTranslation@luzmo/analytics-components-kit/types Shape for overriding one option's translation data (label, description). Used with customTranslations .
TranslationOverrides@luzmo/analytics-components-kit/types Flat override map keyed by option key. A broader alternative to OptionTranslation when you override multiple options.
TranslationsFile@luzmo/analytics-components-kit/types Full translations object (groups + options). Can be passed to customTranslations as an alternative to TranslationOverrides .
Slot@luzmo/analytics-components-kit/types Shape of a slot entry in the slots array. Option visibility and default logic often depends on slot configuration and contents.
ThemeConfig@luzmo/analytics-components-kit/types Theme configuration object passed through the theme property. Used by theme-aware pickers and style-related options.
VizItemType@luzmo/analytics-components-kit/types String literal union of supported chart types.

The luzmo-options-changed event does not currently have a named exported interface. Its payload shape is CustomEvent<{ options: Record<string, unknown> }> .

CSS Variables

All CSS variables in this section can be set on luzmo-item-option { ... } or on a parent container. They cascade into the internally rendered control.

Base

Variable Description
--luzmo-item-option-font-family Font family of the host element.
--luzmo-item-option-font-size Base font size when size is not set.
--luzmo-item-option-font-size-s Font size for size="s" .
--luzmo-item-option-font-size-l Font size for size="l" .
--luzmo-item-option-font-size-xl Font size for size="xl" .
--luzmo-item-option-component-font-family Font family for the internal option row.
--luzmo-item-option-component-height Height of the internal option row.
--luzmo-item-option-control-container-gap Gap between elements inside the control.
--luzmo-item-option-extra-label-padding-left Left padding for the extra-label area.
--luzmo-item-option-extra-label-padding-right Right padding for the extra-label area.
--luzmo-item-option-extra-label-font-size Font size for the extra-label area.

Action Button Group

These variables apply when control.type="action-button-group" .

Variable Description
--luzmo-item-option-action-button-group-button-background-hover Button background on hover.
--luzmo-item-option-action-button-group-button-background-down Button background while pressed.
--luzmo-item-option-action-button-group-button-background-focus Button background on focus.
--luzmo-item-option-action-button-group-button-content-color-default Button content color by default.
--luzmo-item-option-action-button-group-button-content-color-hover Button content color on hover.
--luzmo-item-option-action-button-group-button-content-color-down Button content color while pressed.
--luzmo-item-option-action-button-group-button-content-color-focus Button content color on focus.

Position Picker

These variables apply when control.type="position-picker" .

Variable Description
--luzmo-item-option-position-picker-grid-height Grid height.
--luzmo-item-option-position-picker-grid-gap Gap between grid items.
--luzmo-item-option-position-picker-grid-width Grid width.
--luzmo-item-option-position-picker-grid-border-color Grid border color.
--luzmo-item-option-position-picker-grid-border-radius Grid border radius.
--luzmo-item-option-position-picker-grid-padding Grid padding.
--luzmo-item-option-position-picker-item-height Height of each selectable position.
--luzmo-item-option-position-picker-border-color Border color for position items.
--luzmo-item-option-position-picker-border-radius Border radius for position items.
--luzmo-item-option-position-picker-background Background for position items.
--luzmo-item-option-position-picker-background-hover Background on hover.
--luzmo-item-option-position-picker-background-selected Background for the selected item.
--luzmo-item-option-position-picker-animation-duration Hover/background transition duration.
--luzmo-item-option-position-picker-selected-animation-duration Selected-state transition duration.

Positions Number Field

These variables apply when control.type="positions-number-field" .

Variable Description
--luzmo-item-option-positions-number-field-container-max-width Max width of the 3x3 positions grid.
--luzmo-item-option-positions-number-field-container-row-gap Row gap of the positions grid.
--luzmo-item-option-positions-number-field-container-column-gap Column gap of the positions grid.
--luzmo-item-option-positions-number-field-sync-border-width Border width for the sync button.
--luzmo-item-option-positions-number-field-sync-border-color Border color for the sync button.
--luzmo-item-option-positions-number-field-sync-border-radius Border radius for the sync button.
--luzmo-item-option-positions-number-field-sync-height Height of the center sync button.
--luzmo-item-option-positions-number-field-no-sync-center-border-width Border width for the no-sync center state.
--luzmo-item-option-positions-number-field-no-sync-center-border-color Border color for the no-sync center state.
--luzmo-item-option-positions-number-field-no-sync-center-border-radius Border radius for the no-sync center state.
--luzmo-item-option-positions-number-field-no-sync-center-background-color Background color for the no-sync center.

Color Range

These variables apply when control.type="color-range" .

Variable Description
--luzmo-item-option-color-range-ranges-gap Gap between color range lines.
--luzmo-item-option-color-range-color-swatch-to-percentage Spacing between swatch and percentage label.
--luzmo-item-option-color-range-percentage-to-input-field Spacing between percentage label and input.
--luzmo-item-option-color-range-color-swatch-to-input-field Spacing between swatch and input field.
--luzmo-item-option-color-range-input-field-to-button Spacing between input field and action button.
--luzmo-item-option-color-range-connector-border-width Border width for the connector between swatches.
--luzmo-item-option-color-range-connector-border-color Border color for the connector between swatches.
--luzmo-item-option-color-range-add-value-width Width of the add-value button.
--luzmo-item-option-color-range-add-value-height Height of the add-value button.
--luzmo-item-option-color-range-add-value-border-width Border width of the add-value button.
--luzmo-item-option-color-range-add-value-border-color Border color of the add-value button.
--luzmo-item-option-color-range-add-value-border-radius Border radius of the add-value button.
--luzmo-item-option-color-range-add-value-background-color Background color of the add-value button.
--luzmo-item-option-color-range-add-value-background-color-hover Background color on hover.
--luzmo-item-option-color-range-add-value-background-color-focus Background color on focus.
--luzmo-item-option-color-range-add-value-color Icon or foreground color of the add-value button.
--luzmo-item-option-color-range-add-value-color-hover Icon or foreground color on hover.
--luzmo-item-option-color-range-add-value-color-focus Icon or foreground color on focus.
--luzmo-item-option-color-range-add-color-range-size Size basis used to position the plus sign.
--luzmo-item-option-color-range-add-color-range-plus-sign-border-width Stroke width of the plus sign.
--luzmo-item-option-color-range-add-value-focus-indicator-gap Focus indicator gap.
--luzmo-item-option-color-range-add-value-focus-indicator-background-color Focus indicator background.
--luzmo-item-option-color-range-add-value-focus-indicator-width Focus indicator border width.
--luzmo-item-option-color-range-add-value-focus-indicator-color Focus indicator border color.
--luzmo-item-option-color-range-add-value-focus-indicator-border-radius Focus indicator border radius.

Code examples

index.html
Web component
Angular
React
React Native
Vue
<luzmo-item-option
  id="itemOptionBuiltIn"
  item-type="bar-chart"
  option-key="display.title"
  language="en"
  size="m"
></luzmo-item-option>

<luzmo-item-option
  id="itemOptionCustom"
  language="en"
  size="m"
></luzmo-item-option>

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

  let options = {
    display: { title: true },
    chartColor: '#336699'
  };

  const itemOptionBuiltIn = document.getElementById('itemOptionBuiltIn');
  const itemOptionCustom = document.getElementById('itemOptionCustom');

  itemOptionBuiltIn.options = options;
  itemOptionBuiltIn.slots = [];

  itemOptionCustom.options = options;
  itemOptionCustom.customOptionConfiguration = {
    key: 'chartColor',
    control: {
      type: 'color-picker',
      default: '#336699'
    }
  };
  itemOptionCustom.customTranslations = {
    label: 'Chart color',
    description: 'Primary color used for chart elements.'
  };

  const syncOptions = (nextOptions) => {
    options = nextOptions;
    itemOptionBuiltIn.options = options;
    itemOptionCustom.options = options;
  };

  itemOptionBuiltIn.addEventListener('luzmo-options-changed', (event) => {
    syncOptions(event.detail.options);
  });

  itemOptionCustom.addEventListener('luzmo-options-changed', (event) => {
    syncOptions(event.detail.options);
  });
</script>
Did this page help you?
Yes No