Skip to main content
Module

x/netlify_cms_config/mod.ts>Field

Netlify CMS config generator
Latest
class Field
Re-export
import { Field } from "https://deno.land/x/netlify_cms_config@v0.3.2/mod.ts";

Constructors

new
Field(label: string, config: Options)

Type Parameters

optional
Options extends BaseOptions = BaseOptions

Properties

config: Options
label: string
widget: string

Methods

getName(): string

Get the current name

hint(hint: string): this

Optionally add helper text directly below a widget. Useful for including instructions. Accepts markdown for bold, italic, strikethrough, and links.

name(name: string): this

Change the field name

pattern(pattern: string, error: string): this

Add field validation by specifying a list with a regex pattern and an error message.

required(required?): this

Makes the field mandatory.

toJSON(): Record<string, any>

Return the field as JSON