Skip to content

bytes

bytes<TCollectionSlug, TFieldKey, TFieldMeta>(options?): BytesField<TCollectionSlug, TFieldMeta>

Defined in: packages/core/src/fields/bytes/config.ts:42

Creates a bytes field that stores a raw binary payload (v.bytes()).

Accepts BytesFieldInput (all optional) and returns BytesField with all defaults applied.

Defaults applied:

  • label — "" (inferred from the field key by defineCollection)
  • required — false
  • maxSize — 524_288 (512 KiB)
  • accept — ""
  • defaultValue — undefined
  • admin.hidden — false
  • admin.readOnly — false
  • admin.position — "main"
  • admin.width — "100%"
  • admin.cellAlignment — "left"

TCollectionSlug extends string = string

TFieldKey extends string = never

TFieldMeta extends BaseFieldMeta = BaseFieldMeta

BytesFieldInput<TCollectionSlug, TFieldKey, TFieldMeta>

Bytes field configuration. All properties are optional.

BytesField<TCollectionSlug, TFieldMeta>

Resolved bytes field definition with all defaults applied.

import { bytes, defineCollection } from '@vexcms/core'
storageShapes: defineCollection({
fields: {
payload: bytes({ label: "Payload", maxSize: 65_536 }),
}
})