llms.txt: machine-readable documentation index. Markdown version of this page is also available.

IntelliJ Platform Plugin SDK Help

Removed Old Version of Kotlin UI DSL

Comparison with Current Kotlin UI DSL

The current Kotlin UI DSL fixes some crucial problems of the old version. See Migration on how to port existing UI DSL code from the old version to the current one.

The following significant changes were made:

  • Reduced API, which allows conceiving API easier and faster. Example: there were five overloaded methods Cell.checkBox() in the old version, now only one method remains. Functionality for binding properties is extracted into Cell<T>.bindSelected() methods.

  • UI DSL became stricter, so the available API in every context is much smaller. Example: code like row { row { is forbidden now.

  • Structured API is mostly based on interfaces because it's easier to learn API by grouped methods. Only a small part of the API is implemented as extensions.

  • KDoc is widely used.

  • MIG layout is fully removed from the new UI DSL and replaced by GridLayout. Because MIG layout is an external library, it's hard to fix bugs there (e.g., there are layout problems when components become invisible) and extend its functionality. Fixed focus ring cropping problems: when components are placed near the panel border focus ring could be cropped if panel insets do not specify enough space.

  • Implemented Placeholder that allows replacing components at runtime after content is shown.

Migration

The current API is very similar to the old one and covers almost all of its functionality, so moving to the current version can be done quickly.

The old version was located in the com.intellij.ui.layout package.

The current version is located in the com.intellij.ui.dsl.builder package.

Migration Steps

  1. Having a screenshot or live version of the initial components layout can help

  2. Remove imports of old UI DSL starting with com.intellij.ui.layout

  3. Go to the place where the panel is created and import the current UI DSL com.intellij.ui.dsl.builder suggested by IntelliJ IDEA

  4. Update non-compilable code, according to the following table.

    Old Kotlin UI DSL

    Kotlin UI DSL

    row { row {

    indent { row {

    row { cell(isFullWidth = true)

    row {

    fullRow {

    row {

    titledRow(…) {

    group(…) {

    hideableRow

    collapsibleGroup

    cell used as sub-grid

    row { panel { … } }

    component(…) or its invocation via ()

    cell(…)

    enableIf

    enabledIf

    checkBox(text, bindOptions)

    checkBox(text).bindSelected(bindOptions)

    radioButton(text, bindOptions)

    radioButton(text).bindSelected(bindOptions)

    comboBox(…, bindOptions)

    comboBox(text).bindItem(bindOptions)

    textField(bindOptions, columns)

    textField().bindText(bindOptions).columns(columns)

    scrollableTextArea(bindOptions, rows, columns)

    textArea().bindText(bindOptions).rows(rows).columns(columns)

    intTextField(bindOptions, columns, range, step)

    intTextField(range, step).bindIntText(bindOptions).columns(columns)

    textFieldWithBrowseButton(bindOptions, …)

    textFieldWithBrowseButton(…).bindText(bindOptions)

    .growPolicy(GrowPolicy.SHORT_TEXT)

    .columns(COLUMNS_SHORT)

    .growPolicy(GrowPolicy.MEDIUM_TEXT)

    .columns(COLUMNS_MEDIUM)

    label(…, bold = true)

    label(…).bold()

    withLeftGap()

    For previous left cell use Cell.gap(SMALL)

    withLeftGap(gapLeft)

    Do not use custom gaps if possible

    withLargeLeftGap()

    Not needed, this gap is set by default

    withValidationOnInput

    validationOnInput

    withValidationOnApply

    validationOnApply

    withErrorOnApplyIf

    errorOnApply

    withBinding

    bind

    01 December 2026