# Field previews

****

The <a href="https://getkirby.com/docs/reference/panel/fields/structure">structure field</a> tries to create the best possible preview for the field in its table view, once you have submitted the form.

<figure class="image"><a data-lightbox href="https://assets.getkirby.com/media/pages/docs/reference/plugins/extensions/field-previews/c26c0f023d-1717846665/field-previews.png?width=2136&amp;height=496&amp;enlarge=0"><img alt="" class="rounded" height="215" loading="lazy" sizes="auto" src="https://assets.getkirby.com/media/pages/docs/reference/plugins/extensions/field-previews/c26c0f023d-1717846665/field-previews.png?width=924&amp;height=215&amp;enlarge=0" srcset="https://assets.getkirby.com/media/pages/docs/reference/plugins/extensions/field-previews/c26c0f023d-1717846665/field-previews.png?width=462&amp;height=107&amp;enlarge=0 462w, https://assets.getkirby.com/media/pages/docs/reference/plugins/extensions/field-previews/c26c0f023d-1717846665/field-previews.png?width=690&amp;height=160&amp;enlarge=0 690w, https://assets.getkirby.com/media/pages/docs/reference/plugins/extensions/field-previews/c26c0f023d-1717846665/field-previews.png?width=924&amp;height=215&amp;enlarge=0 924w, https://assets.getkirby.com/media/pages/docs/reference/plugins/extensions/field-previews/c26c0f023d-1717846665/field-previews.png?width=1380&amp;height=320&amp;enlarge=0 1380w, https://assets.getkirby.com/media/pages/docs/reference/plugins/extensions/field-previews/c26c0f023d-1717846665/field-previews.png?width=1848&amp;height=429&amp;enlarge=0 1848w" width="924"></a></figure>

For more complex fields like URL, email, files, pages or users, we provide special preview components in <abbr title="Vue is the JavaScript framework Kirby's admin Panel is built with."><a href="https://getkirby.com/docs/glossary/#vue">Vue</a></abbr> that take care of rendering the result in a nice way.

If you create your own <a href="https://getkirby.com/docs/reference/plugins/extensions/fields">field plugins</a>, you might want to optimize the preview of such fields in the structure table as well. This can be done with custom field preview components in your plugin.

```js "/site/plugins/demo/index.js"
panel.plugin('demo/plugin', {
  fields: {
	  myfield: {
		  ...
	  }
  },
  components: {
    'k-myfield-field-preview': {
      props: {
        value: String,
        column: Object,
        field: Object
      },
      template: '<p>Your preview code goes here</p>'
    }
  }
});
```

## Naming

The important part here is that you get the naming of the component right. Otherwise the structure field cannot find your preview component:

```js
"k-${yourFieldName}-field-preview"
```

## Props

The preview component automatically receives the following props:

| Prop | Type | Description |
| - | - | - |
| `value` | mixed | The current value that has been entered in the form |
| `column` | Object | The optional column definition from the blueprint |
| `field` | Object | The field definition from the blueprint |

You don't necessarily have to register them all. Register the ones you need for your preview. It's fine if you only need the value.