@sanity/cli
Version:
Sanity CLI tool for managing Sanity installations, managing plugins, schemas and datasets
38 lines (36 loc) • 722 B
JavaScript
import {defineField, defineType} from 'sanity'
import {MdPerson as icon} from 'react-icons/md'
export default defineType({
name: 'person',
title: 'Person',
type: 'document',
icon,
fields: [
defineField({
name: 'name',
title: 'Name',
type: 'string',
description: 'Please use "Firstname Lastname" format',
}),
defineField({
name: 'slug',
title: 'Slug',
type: 'slug',
options: {
source: 'name',
maxLength: 100,
},
}),
defineField({
name: 'image',
title: 'Image',
type: 'image',
options: {
hotspot: true,
},
}),
],
preview: {
select: {title: 'name', media: 'image'},
},
})