This page demonstrates how to add and customize a LookML dashboard element of `type: text` with LookML dashboard parameters in a [`dashboard.lkml` file](https://docs.cloud.google.com/looker/docs/other-project-files#dashboard_files).

For information about adding text to a dashboard through the Looker UI, see the [Creating user-defined dashboards](https://docs.cloud.google.com/looker/docs/creating-user-defined-dashboards#adding_text) documentation page.

## Example usage


    ## BASIC PARAMETERS
    name: element_name
    type: text
    height: N
    width: N
    top: N
    left: N
    row: N
    col: N

    ## TEXT PARAMETERS
    title_text: title text
    subtitle_text: subtitle text
    body_text: body text

## Parameter definitions

| Parameter Name | Description |
|---|---|---|
| Basic Parameters |||
| [`name` (for elements)](https://docs.cloud.google.com/looker/docs/reference/param-lookml-dashboard-text-tile#name) | Creates an element |
| [`type` (for elements)](https://docs.cloud.google.com/looker/docs/reference/param-lookml-dashboard-text-tile#type) | Determines the type of visualization to be used in the element |
| [`height` (for elements)](https://docs.cloud.google.com/looker/docs/reference/param-lookml-dashboard-text-tile#height) | Defines the height of an element in units of [`tile_size`](https://docs.cloud.google.com/looker/docs/reference/param-lookml-dashboard#tile_size) for [`layout: tile`](https://docs.cloud.google.com/looker/docs/reference/param-lookml-dashboard#layout) and [`layout: static`](https://docs.cloud.google.com/looker/docs/reference/param-lookml-dashboard#layout) dashboards |
| [`width` (for elements)](https://docs.cloud.google.com/looker/docs/reference/param-lookml-dashboard-text-tile#width) | Defines the width of an element in units of [`tile_size`](https://docs.cloud.google.com/looker/docs/reference/param-lookml-dashboard#tile_size) for [`layout: tile`](https://docs.cloud.google.com/looker/docs/reference/param-lookml-dashboard#layout) and [`layout: static`](https://docs.cloud.google.com/looker/docs/reference/param-lookml-dashboard#layout) dashboards |
| [`top`](https://docs.cloud.google.com/looker/docs/reference/param-lookml-dashboard-text-tile#top_param) | Defines the top-to-bottom position of an element in units of [`tile_size`](https://docs.cloud.google.com/looker/docs/reference/param-lookml-dashboard#tile_size) for [`layout: static`](https://docs.cloud.google.com/looker/docs/reference/param-lookml-dashboard#layout) dashboards |
| [`left`](https://docs.cloud.google.com/looker/docs/reference/param-lookml-dashboard-text-tile#left) | Defines the left-to-right position of an element in units of [`tile_size`](https://docs.cloud.google.com/looker/docs/reference/param-lookml-dashboard#tile_size) for [`layout: static`](https://docs.cloud.google.com/looker/docs/reference/param-lookml-dashboard#layout) dashboards |
| [`row`](https://docs.cloud.google.com/looker/docs/reference/param-lookml-dashboard-text-tile#row) | Defines the top-to-bottom position of an element in units of rows for [`layout: newspaper`](https://docs.cloud.google.com/looker/docs/reference/param-lookml-dashboard#layout) dashboards |
| [`col`](https://docs.cloud.google.com/looker/docs/reference/param-lookml-dashboard-text-tile#col) | Defines the left-to-right position of an element in units of columns for [`layout: newspaper`](https://docs.cloud.google.com/looker/docs/reference/param-lookml-dashboard#layout) dashboards |
| Text Parameters |||
| [`title_text`](https://docs.cloud.google.com/looker/docs/reference/param-lookml-dashboard-text-tile#title_text) | Specifies a title for a dashboard element of `type: text` |
| [`subtitle_text`](https://docs.cloud.google.com/looker/docs/reference/param-lookml-dashboard-text-tile#subtitle_text) | Specifies a subtitle for a dashboard element of `type: text` |
| [`body_text`](https://docs.cloud.google.com/looker/docs/reference/param-lookml-dashboard-text-tile#body_text) | Specifies body text for a dashboard element of `type: text` |

## Basic parameters

When defining a LookML dashboard element of `type: text`, you must specify values for at least the [`name`](https://docs.cloud.google.com/looker/docs/reference/param-lookml-dashboard-text-tile#name) and [`type`](https://docs.cloud.google.com/looker/docs/reference/param-lookml-dashboard-text-tile#type) parameters.


### `name`

> This section refers to the `name` parameter that is part of a [dashboard element](https://docs.cloud.google.com/looker/docs/reference/param-lookml-dashboard-element).
>
> `name` can also be used as part of a dashboard filter, described on the [Dashboard parameters](https://docs.cloud.google.com/looker/docs/reference/param-lookml-dashboard#name-for-filters) documentation page.

Each `name` declaration creates a new dashboard element and assigns it a name.
Element names must be unique. Names are sometimes referenced in the
[`elements`](https://docs.cloud.google.com/looker/docs/reference/param-lookml-dashboard#elements-for-rows)
parameter when you're using
[`layout: grid`](https://docs.cloud.google.com/looker/docs/reference/param-lookml-dashboard#layout)
dashboards, or in the
[`group`](https://docs.cloud.google.com/looker/docs/reference/param-lookml-dashboard#group) parameter of
child elements when you're organizing elements into a tile group
(`type: group`).

    - name: orders_by_date

### `type`

> This section refers to the `type` parameter that is part of a [dashboard element](https://docs.cloud.google.com/looker/docs/reference/param-lookml-dashboard-element).
>
> `type` can also be used as part of a dashboard filter, described on the [Dashboard parameters](https://docs.cloud.google.com/looker/docs/reference/param-lookml-dashboard#type-for-filters) documentation page.
>
> `type` can also be used as part of a join, described on the [`type` (for joins)](https://docs.cloud.google.com/looker/docs/reference/param-explore-join-type) parameter documentation page.
>
> `type` can also be used as part of a dimension, described on the [Dimension, filter, and parameter types](https://docs.cloud.google.com/looker/docs/reference/param-dimension-filter-parameter-types) documentation page.
>
> `type` can also be used as part of a measure, described on the [Measure types](https://docs.cloud.google.com/looker/docs/reference/param-measure-types) documentation page.

The `type` parameter determines the type of visualization to be used in the element.

    - name: element_name
      type: text | looker_grid | table | single_value | looker_single_record |
            looker_column | looker_bar | looker_scatter | looker_line | looker_area |
            looker_pie | looker_donut_multiples | looker_funnel | looker_timeline |
            looker_map | looker_google_map | looker_geo_coordinates | looker_geo_choropleth |
            looker_waterfall | looker_wordcloud | looker_boxplot | button | group

See the [`type` (for LookML dashboards)](https://docs.cloud.google.com/looker/docs/reference/param-lookml-dashboard-type) documentation page for an overview of the different types of LookML dashboard elements.

### `height`

> This section refers to the `height` parameter that is part of a [dashboard element](https://docs.cloud.google.com/looker/docs/reference/param-lookml-dashboard-element).
>
> `height` can also be used as part of a dashboard row, described on the [Dashboard parameters](https://docs.cloud.google.com/looker/docs/reference/param-lookml-dashboard#height-for-rows) documentation page.

#### For dashboards with `tile` or `static` layouts

The `height` parameter defines the height of an element, in units of [`tile_size`](https://docs.cloud.google.com/looker/docs/reference/param-lookml-dashboard#tile_size) (which is defined in pixels), for [`layout: tile`](https://docs.cloud.google.com/looker/docs/reference/param-lookml-dashboard#layout) and [`layout: static`](https://docs.cloud.google.com/looker/docs/reference/param-lookml-dashboard#layout) dashboards.

For example, the following code specifies `tile_size: 100` and `height: 4`, making the `orders_by_date` element 400 pixels in height.

    - dashboard: sales_overview
      tile_size: 100
      ...

      elements:
      - name: orders_by_date
        height: 4
        ...

#### For dashboards with `newspaper` layout

The `height` parameter defines the height of an element, in units of [row](https://docs.cloud.google.com/looker/docs/reference/param-lookml-dashboard-text-tile#row), for [`layout: newspaper`](https://docs.cloud.google.com/looker/docs/reference/param-lookml-dashboard#layout) dashboards.

A dashboard with newspaper layout defaults to an element height of 6 rows, or about 300 pixels. The minimum height is 1 row for dashboards with a [`preferred viewer`](https://docs.cloud.google.com/looker/docs/reference/param-lookml-dashboard#preferred_viewer) parameter set to `dashboards-next`. The minimum height is 2 rows for dashboards with a `preferred viewer` parameter set to `dashboards`.

For example, the following code sets an element to be 12 rows tall, or twice as tall as other elements that are set to the default:

    - dashboard: sales_overview
      layout: newspaper
      ...

      elements:
      - name: orders_by_date
        height: 12
        ...

### `width`

> This section refers to the `width` parameter that is part of a [dashboard element](https://docs.cloud.google.com/looker/docs/reference/param-lookml-dashboard-element).
>
> `width` can also be used as part of a dashboard, described on the [Dashboard parameters](https://docs.cloud.google.com/looker/docs/reference/param-lookml-dashboard#width-for-dashboard) documentation page.

The `width` parameter defines the width of an element, in units of [`tile_size`](https://docs.cloud.google.com/looker/docs/reference/param-lookml-dashboard#tile_size), for [`layout: tile`](https://docs.cloud.google.com/looker/docs/reference/param-lookml-dashboard#layout) and [`layout: static`](https://docs.cloud.google.com/looker/docs/reference/param-lookml-dashboard#layout) dashboards.

For example, the following code specifies `tile_size: 100` and `width: 4`, making the `orders_by_date` element 400 pixels in width.

    - dashboard: sales_overview
      tile_size: 100
      ...

      elements:
      - name: orders_by_date
        width: 4
        ...

The `width` parameter defines the width of an element, in units of columns, for [`layout: newspaper`](https://docs.cloud.google.com/looker/docs/reference/param-lookml-dashboard#layout) dashboards.

A dashboard with newspaper layout defaults to a width of 24 columns.

For example, the following code sets the element to half the width of the dashboard:

    - dashboard: sales_overview
      layout: newspaper
      ...

      elements:
      - name: orders_by_date
        width: 12
        ...


### `top`

The `top` parameter defines the top-to-bottom position of an element, in units of [`tile_size`](https://docs.cloud.google.com/looker/docs/reference/param-lookml-dashboard#tile_size), for [`layout: static`](https://docs.cloud.google.com/looker/docs/reference/param-lookml-dashboard#layout) dashboards.

For example, the following code specifies `tile_size: 100` and `top: 4`, positioning the top edge of the `orders_by_date` element 400 pixels from the top of the dashboard.

    - dashboard: sales_overview
      tile_size: 100
      ...

      elements:
      - name: orders_by_date
        top: 4
        ...

### `left`

The `left` parameter defines the left-to-right position of an element, in units of [`tile_size`](https://docs.cloud.google.com/looker/docs/reference/param-lookml-dashboard#tile_size), for [`layout: static`](https://docs.cloud.google.com/looker/docs/reference/param-lookml-dashboard#layout) dashboards.

For example, the following code specifies `tile_size: 100` and `left: 4`, positioning the left edge of the `orders_by_date` element 400 pixels from the left side of the dashboard.

    - dashboard: sales_overview
      tile_size: 100
      ...

      elements:
      - name: orders_by_date
        left: 4
        ...

### `row`

For [`layout: newspaper`](https://docs.cloud.google.com/looker/docs/reference/param-lookml-dashboard#layout)
dashboards, the `row` parameter defines the row that the top edge of an element
is placed on. If the element is placed inside a tile group by using the
[`group`](https://docs.cloud.google.com/looker/docs/reference/param-lookml-dashboard#group) parameter, `row`
defines the row position of the element relative to the top of the group
container (`row: 0`).

A dashboard begins with row 0 at the top of the dashboard. A dashboard with newspaper layout defaults to an element height of 6 rows, meaning the dashboard elements at the top of a dashboard (`row: 0`) would default to taking up rows 0-5.

Each row is 50 pixels tall, which means the default element height of 6 rows is 300 pixels.

For example, the following code sets an element to be set on the second row of elements in the dashboard, assuming elements are set at the default height:

    - dashboard: sales_overview
      layout: newspaper
      ...

      elements:
      - name: orders_by_date
        row: 6
        ...

### `col`

For [`layout: newspaper`](https://docs.cloud.google.com/looker/docs/reference/param-lookml-dashboard#layout)
dashboards, the `col` parameter defines the column that the left edge of the
element is placed on. If the element is placed inside a tile group by using the
[`group`](https://docs.cloud.google.com/looker/docs/reference/param-lookml-dashboard#group) parameter, `col`
defines the column position of the element relative to the left edge of the
group container (`col: 0`).

Dashboards are divided into 24 columns. A dashboard begins with column 0 at the left of the dashboard. A dashboard with newspaper layout defaults to an element width of 8 columns, meaning the dashboard elements at the left of a dashboard (`col: 0`) would default to taking up columns 0-7.

For example, the following code sets an element to be set in the third column of elements in the dashboard:

    - dashboard: sales_overview
      layout: newspaper
      ...

      elements:
      - name: orders_by_date
        col: 16
        ...

## Text parameters

> Dashboard LookML that is generated from text tiles created with the [**Text**](https://docs.cloud.google.com/looker/docs/creating-user-defined-dashboards#adding_text_tiles) option in the Looker UI will not use the `title_text` or `subtitle_text` parameters.

The parameters described in this section can be used to add content to a LookML dashboard element of `type: text`.

### `title_text`

The `title_text` parameter specifies the text that will appear on a `type: text` element in the largest font size available. It is shown at the top of the tile.

    title_text: title text

### `subtitle_text`

The `subtitle_text` parameter specifies the text that will appear on a `type: text` element in the middle font size available. If `title_text` is present, the `subtitle_text` will appear below it.

    subtitle_text: subtitle text

### `body_text`

The `body_text` parameter specifies the text that will appear on a `type: text` element in the smallest font size available. This parameter is shown last in the text tile. The [Using Markdown in Markdown tiles](https://docs.cloud.google.com/looker/docs/using-markdown-in-text-tiles) documentation page provides an overview of the Markdown that you can use to format text or to add links and images to a text tile.

    body_text: body text