66 lines
2.3 KiB
Plaintext
66 lines
2.3 KiB
Plaintext
---
|
|
title: Row Field
|
|
label: Row
|
|
order: 150
|
|
desc: With the Row field you can arrange fields next to each other in the Admin Panel to help you customize your Dashboard.
|
|
keywords: row, fields, config, configuration, documentation, Content Management System, cms, headless, javascript, node, react, nextjs
|
|
---
|
|
|
|
<Banner>
|
|
The Row field is presentational-only and only affects the Admin Panel. By using it, you can
|
|
arrange fields next to each other horizontally.
|
|
</Banner>
|
|
|
|
<LightDarkImage
|
|
srcLight="https://payloadcms.com/images/docs/fields/row.png"
|
|
srcDark="https://payloadcms.com/images/docs/fields/row-dark.png"
|
|
alt="Shows a row field in the Payload Admin Panel"
|
|
caption="Admin Panel screenshot of a Row field"
|
|
/>
|
|
|
|
## Config
|
|
|
|
| Option | Description |
|
|
| --------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
| **`fields`** \* | Array of field types to nest within this Row. |
|
|
| **`admin`** | Admin-specific configuration excluding `description`, `readOnly`, and `hidden`. See the [default field admin config](/docs/fields/overview#admin-config) for more details. |
|
|
| **`custom`** | Extension point for adding custom data (e.g. for plugins) |
|
|
|
|
_\* An asterisk denotes that a property is required._
|
|
|
|
## Example
|
|
|
|
`collections/ExampleCollection.ts`
|
|
|
|
```ts
|
|
import { CollectionConfig } from 'payload'
|
|
|
|
export const ExampleCollection: CollectionConfig = {
|
|
slug: 'example-collection',
|
|
fields: [
|
|
{
|
|
type: 'row', // required
|
|
fields: [
|
|
// required
|
|
{
|
|
name: 'label',
|
|
type: 'text',
|
|
required: true,
|
|
admin: {
|
|
width: '50%',
|
|
},
|
|
},
|
|
{
|
|
name: 'value',
|
|
type: 'text',
|
|
required: true,
|
|
admin: {
|
|
width: '50%',
|
|
},
|
|
},
|
|
],
|
|
},
|
|
],
|
|
}
|
|
```
|