Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/fields/overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -609,7 +609,7 @@ The following options are available:
| **`condition`** | Programmatically show / hide fields based on other fields. [More details](#conditional-logic). |
| **`components`** | All Field Components can be swapped out for [Custom Components](../custom-components/overview) that you define. |
| **`description`** | Helper text to display alongside the field to provide more information for the editor. [More details](#description). |
| **`position`** | Specify if the field should be rendered in the sidebar by defining `position: 'sidebar'`. |
| **`position`** | Use `'sidebar'` to render the field in the sidebar or `'main'` (default) to keep it in the main area. |
| **`width`** | Restrict the width of a field. You can pass any string-based value here, be it pixels, percentages, etc. This property is especially useful when fields are nested within a `Row` type where they can be organized horizontally. |
| **`style`** | [CSS Properties](https://developer.mozilla.org/en-US/docs/Web/CSS) to inject into the root element of the field. |
| **`className`** | Attach a [CSS class attribute](https://developer.mozilla.org/en-US/docs/Web/CSS/Class_selectors) to the root DOM element of a field. |
Expand Down
6 changes: 4 additions & 2 deletions packages/payload/src/fields/config/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,8 @@ export type BlocksFilterOptions<TData = any> =
) => BlockSlugOrString | Promise<BlockSlugOrString | true> | true)
| BlockSlugOrString

export type FieldPosition = 'main' | 'sidebar'

export type FieldAdmin = {
className?: string
components?: {
Expand Down Expand Up @@ -382,7 +384,7 @@ export type FieldAdmin = {
*/
disableListFilter?: boolean
hidden?: boolean
position?: 'sidebar'
position?: FieldPosition
readOnly?: boolean
style?: CSSProperties
width?: CSSProperties['width']
Expand Down Expand Up @@ -411,7 +413,7 @@ export type AdminClient = {
*/
disableListFilter?: boolean
hidden?: boolean
position?: 'sidebar'
position?: FieldPosition
readOnly?: boolean
style?: { '--field-width'?: CSSProperties['width'] } & CSSProperties
width?: CSSProperties['width']
Expand Down
Loading