Annotations Reference

Complete reference for all @dial annotations. These JSDoc comments control how your UI is generated.

Quick Reference

/**
 * Property description
 * @dial <group>               // Assign to group
 * @dial-dtype <type>          // Data type
 * @dial-label <text>          // Display label
 * @dial-icon <name>           // Lucide icon
 * @dial-min <number>          // Min value
 * @dial-max <number>          // Max value
 * @dial-step <number>         // Step increment
 * @dial-options [...]         // Select options
 * @dial-value <default>       // Default value
 * @dial-order <number>        // Display order in group
 * @dial-group-order <number>  // Group display order
 */
propertyName: type;

Property Annotations

Core Annotations

AnnotationDescriptionValuesExample
@dial <group>Assigns property to a named group. Groups related properties together for organized UI.string@dial appearance
@dial-dtype <type>Specifies data type explicitly. Overrides automatic type inference. Supported: boolean, number, int, number-int, string, color, select, vector, vector3, euler, interface, objectstring@dial-dtype color
@dial-ignoreExcludes property from schema. Use for internal properties, React props like className, or any property you don't want in the control panel-@dial-ignore
@dial-options <json>Options for select/dropdown. Required for select dtype. Can be an array of strings or objects with label/value pairsarray@dial-options ["a", "b", "c"]

Display Annotations

AnnotationDescriptionValuesExample
@dial-label <text>Custom display label. Overrides property name as control labelstring@dial-label "3D Position"
@dial-icon <name>Lucide icon name. Adds icon next to control. See Lucide Iconsstring@dial-icon Palette
@dial-placeholder <text>Input placeholder text. Shows hint text in empty inputsstring@dial-placeholder "Enter..."
@dial-tooltip <text>Hover tooltip. Displays helpful information on hoverstring@dial-tooltip "Help text"

Numeric Constraints

AnnotationDescriptionValuesExample
@dial-min <n>Minimum value for numeric inputsnumber@dial-min 0
@dial-max <n>Maximum value for numeric inputsnumber@dial-max 100
@dial-step <n>Step increment for numeric inputsnumber@dial-step 0.1
@dial-value <v>Default value for the controlany@dial-value 50
@dial-default <v>Alias for @dial-valueany@dial-default "text"

Vector-Specific Annotations

For tuple/vector types with per-element settings.

AnnotationDescriptionValuesExample
@dial-mins <array>Min values per elementnumber[]@dial-mins [0, 0, 0]
@dial-maxs <array>Max values per elementnumber[]@dial-maxs [10, 10, 10]
@dial-steps <array>Step values per elementnumber[]@dial-steps [0.1, 0.1, 0.1]
@dial-dtypes <array>Data types per elementstring[]@dial-dtypes ["int", "int", "int"]
@dial-placeholders <array>Placeholders per elementstring[]@dial-placeholders ["X", "Y", "Z"]
@dial-tooltips <array>Tooltips per elementstring[]@dial-tooltips ["X axis", "Y axis", "Z axis"]

Label Position Annotations

AnnotationDescriptionValuesExample
@dial-label-position <pos>Label positionleft, right, top, bottom, center, inline@dial-label-position top
@dial-label-leftShorthand for left-@dial-label-left
@dial-label-rightShorthand for right-@dial-label-right
@dial-label-topShorthand for top-@dial-label-top
@dial-label-bottomShorthand for bottom-@dial-label-bottom
@dial-label-centerShorthand for center-@dial-label-center
@dial-label-inlineShorthand for inline-@dial-label-inline

Layout Annotations

AnnotationDescriptionValuesExample
@dial-col-span <n>Column span in gridnumber@dial-col-span 2
@dial-row-span <n>Row span in gridnumber@dial-row-span 2

Ordering Annotations

Control the display order of properties and groups in the generated UI.

AnnotationDescriptionValuesExample
@dial-order <n>Property display order within its group. Lower numbers appear first. Properties without order appear after ordered ones.number@dial-order 1
@dial-group-order <n>Group display order. Lower numbers appear first. Groups without order appear after ordered ones.number@dial-group-order 1

Group Annotations

Apply to the first property in a group to configure the entire group layout.

Layout Configuration

AnnotationDescriptionValuesExample
@dial-group-layout <type>Layout systemgrid, flex@dial-group-layout grid
@dial-group-grid-cols <n>Grid columnsnumber@dial-group-grid-cols 3
@dial-group-grid-rows <n>Grid rowsnumber@dial-group-grid-rows 2
@dial-group-grid-flow <dir>Grid flowrow, column@dial-group-grid-flow row
@dial-group-grid-col-templateCSS grid columnsstring@dial-group-grid-col-template "1fr 2fr"
@dial-group-grid-row-templateCSS grid rowsstring@dial-group-grid-row-template "auto 1fr"
@dial-group-flex-wrapFlex wrap behaviornowrap, wrap, wrap-reverse@dial-group-flex-wrap wrap
@dial-group-flex-justify-contentFlex justify contentflex-start, flex-end, center, space-between, space-around, space-evenly@dial-group-flex-justify-content center

Shorthand Group Annotations

ShorthandFull FormDescription
@dial-layout <type>@dial-group-layoutLayout type
@dial-cols <n>@dial-group-grid-colsColumn count
@dial-grid-cols <n>@dial-group-grid-colsColumn count (alternative)
@dial-rows <n>@dial-group-grid-rowsRow count
@dial-grid-rows <n>@dial-group-grid-rowsRow count (alternative)
@dial-flow <dir>@dial-group-grid-flowFlow direction
@dial-grid-flow <dir>@dial-group-grid-flowFlow direction (alternative)
@dial-col-template@dial-group-grid-col-templateColumn template
@dial-grid-col-template@dial-group-grid-col-templateColumn template (alternative)
@dial-row-template@dial-group-grid-row-templateRow template
@dial-grid-row-template@dial-group-grid-row-templateRow template (alternative)
@dial-wrap@dial-group-flex-wrapFlex wrap
@dial-flex-wrap@dial-group-flex-wrapFlex wrap (alternative)
@dial-justify@dial-group-flex-justify-contentFlex justify
@dial-flex-justify-content@dial-group-flex-justify-contentFlex justify (alternative)

Supported Data Types

dtypeTypeScript TypeUI ControlDescription
booleanbooleanToggleOn/off switch
numbernumberSliderDecimal values
int, number-intnumberInteger SliderWhole numbers
stringstringText InputText field
colorstringColor PickerHex color
selectstring | unionDropdownSelect from options
vectorNamed tupleComplex VectorAny dimension, per-element constraints
vector3[n, n, n]3D VectorX, Y, Z inputs (simplified)
euler[n, n, n]Euler AnglesRotation degrees
interfaceinterfaceNested PanelNested control panel
objectobjectNested PanelNested control panel

Examples

Basic Property with All Annotations

interface Props {
  /**
   * Component opacity
   * @dial appearance
   * @dial-dtype number
   * @dial-label "Transparency"
   * @dial-icon Opacity
   * @dial-min 0
   * @dial-max 1
   * @dial-step 0.01
   * @dial-value 1
   * @dial-tooltip "Controls the transparency of the element"
   */
  opacity: number;
}

Group with Layout

interface Props {
  /**
   * X position
   * @dial transform
   * @dial-layout grid
   * @dial-cols 3
   * @dial-icon ArrowRight
   */
  x: number;

  /** @dial transform @dial-icon ArrowUp */
  y: number;

  /** @dial transform @dial-icon ArrowUpRight */
  z: number;
}

Vector with Per-Element Constraints

type RGB = [
  // @dial-min 0 @dial-max 255 @dial-step 1 @dial-dtype int
  r: number,
  // @dial-min 0 @dial-max 255 @dial-step 1 @dial-dtype int
  g: number,
  // @dial-min 0 @dial-max 255 @dial-step 1 @dial-dtype int
  b: number,
];

interface Props {
  /**
   * RGB Color
   * @dial appearance
   * @dial-icon Palette
   * @dial-placeholders ["Red", "Green", "Blue"]
   */
  color: RGB;
}

Select with Options

interface Props {
  /**
   * Material type
   * @dial appearance
   * @dial-dtype select
   * @dial-options ["standard", "metallic", "glass", "emissive"]
   * @dial-icon Sparkles
   * @dial-value "standard"
   */
  material: string;
}

Component-Level Ignore

/**
 * Internal component - excluded from schema
 * @dial-ignore
 */
export const InternalComponent: FC<Props> = () => { };

Property and Group Ordering

interface OrderedProps {
  /**
   * Title - appears first in general group
   * @dial general
   * @dial-group-order 1  // general group appears first
   * @dial-order 1        // title appears first in general
   */
  title: string;

  /**
   * Description - appears second in general group
   * @dial general
   * @dial-order 2        // description appears second
   */
  description: string;

  /**
   * Theme - appears first in appearance group
   * @dial appearance
   * @dial-group-order 2  // appearance group appears second
   * @dial-order 1        // theme appears first in appearance
   */
  theme: string;

  /**
   * Color - appears after theme
   * @dial appearance
   * @dial-order 2        // color appears second
   */
  color: string;

  /**
   * Advanced setting - no explicit order
   * @dial general
   * // Will appear after ordered properties (title, description)
   */
  notes: string;
}

Complete Example

interface CompleteExample {
  // Transform group - 3 columns
  /**
   * 3D Position
   * @dial transform
   * @dial-layout grid
   * @dial-cols 3
   * @dial-dtype vector3
   * @dial-min -100
   * @dial-max 100
   * @dial-step 0.1
   * @dial-placeholders ["X", "Y", "Z"]
   * @dial-icon Move3d
   * @dial-col-span 3
   */
  position: [number, number, number];

  /** @dial transform @dial-dtype number @dial-min -180 @dial-max 180 */
  rotX: number;

  /** @dial transform @dial-dtype number @dial-min -180 @dial-max 180 */
  rotY: number;

  /** @dial transform @dial-dtype number @dial-min -180 @dial-max 180 */
  rotZ: number;

  // Appearance group - 2 columns
  /**
   * Primary color
   * @dial appearance
   * @dial-cols 2
   * @dial-dtype color
   * @dial-icon Palette
   * @dial-value "#3b82f6"
   */
  color: string;

  /**
   * Opacity
   * @dial appearance
   * @dial-dtype number
   * @dial-min 0
   * @dial-max 1
   * @dial-step 0.01
   * @dial-value 1
   */
  opacity: number;

  /**
   * Visible
   * @dial appearance
   * @dial-dtype boolean
   * @dial-icon Eye
   */
  visible: boolean;

  /**
   * Cast shadows
   * @dial appearance
   * @dial-dtype boolean
   * @dial-icon Moon
   */
  shadows: boolean;

  // Hidden property
  /**
   * Internal state
   * @dial-ignore
   */
  _internal: any;
}

Best Practices

  1. Always specify dtype for clarity and correct control rendering
  2. Group related properties using meaningful group names
  3. Use descriptive labels when property names aren't clear
  4. Set appropriate min/max/step for numeric values
  5. Add icons to improve visual recognition
  6. Use placeholders for text inputs and vector elements
  7. Add tooltips for properties that need explanation
  8. Use @dial-ignore for internal/private properties

Next Steps