﻿---
title: razor_attribute_indent_style
description: With curb_razor_format_markup, where an attribute that starts a line inside a start tag goes. Microsoft's Razor formatter reads the same key. Defaults to `align_with_first`
url: https://docs-v3-preview.elastic.dev/reference/razor/code-blocks/razor_attribute_indent_style
---

# razor_attribute_indent_style
With curb_razor_format_markup, where an attribute that starts a line inside a start tag goes. Microsoft's Razor formatter reads the same key.

## Values


| Value              | Notes |
|--------------------|-------|
| `align_with_first` |       |
| `indent_by_one`    |       |
| `indent_by_two`    |       |

**Default:** `align_with_first`
Microsoft's Razor formatter reads the same key with the same values, so one setting serves both. It only applies with `curb_razor_format_markup`. A line inside a start tag that begins with its `>` or `/>` goes where the tag's line does, C# continuing an attribute's value moves as far as the tag's line moved, and text continuing a quoted value is kept as written, since its whitespace is part of the value. With nothing after the tag's name on its line, `align_with_first` puts attributes a level in; Microsoft's formatter, and `curb_razor_markup_engine_quirks`, align them with the tag instead. The examples here are at `indent_size = 2`.

### `razor_attribute_indent_style = align_with_first`

```ini
razor_attribute_indent_style = align_with_first
```

<tab-set>
  <tab-item title="Before">
    ```html
    <div>
    <button class="btn btn-primary" type="button"
    @onclick="Save"
    disabled="@busy">
    Save
    </button>
    <InputText
    @bind-Value="name"
    placeholder="Name" />
    </div>
    ```
  </tab-item>

  <tab-item title="After">
    ```html
    <div>
      <button class="btn btn-primary" type="button"
              @onclick="Save"
              disabled="@busy">
        Save
      </button>
      <InputText
        @bind-Value="name"
        placeholder="Name" />
    </div>
    ```
  </tab-item>
</tab-set>


### `razor_attribute_indent_style = indent_by_one`

```ini
razor_attribute_indent_style = indent_by_one
```

<tab-set>
  <tab-item title="Before">
    ```html
    <div>
    <button class="btn btn-primary" type="button"
    @onclick="Save"
    disabled="@busy">
    Save
    </button>
    <InputText
    @bind-Value="name"
    placeholder="Name" />
    </div>
    ```
  </tab-item>

  <tab-item title="After">
    ```html
    <div>
      <button class="btn btn-primary" type="button"
        @onclick="Save"
        disabled="@busy">
        Save
      </button>
      <InputText
        @bind-Value="name"
        placeholder="Name" />
    </div>
    ```
  </tab-item>
</tab-set>


### `razor_attribute_indent_style = indent_by_two`

```ini
razor_attribute_indent_style = indent_by_two
```

<tab-set>
  <tab-item title="Before">
    ```html
    <div>
    <button class="btn btn-primary" type="button"
    @onclick="Save"
    disabled="@busy">
    Save
    </button>
    <InputText
    @bind-Value="name"
    placeholder="Name" />
    </div>
    ```
  </tab-item>

  <tab-item title="After">
    ```html
    <div>
      <button class="btn btn-primary" type="button"
          @onclick="Save"
          disabled="@busy">
        Save
      </button>
      <InputText
          @bind-Value="name"
          placeholder="Name" />
    </div>
    ```
  </tab-item>
</tab-set>