thomax
thomax

Reputation: 9659

How to define a tokenized tag field in Sanity?

I've seen people sport beautiful tokenized tag-fields in their Sanity studios. I don't think they are using a plug-in, so what's the incantation that will turn my homely array of strings into a tokenized tag field?

Upvotes: 3

Views: 1398

Answers (1)

svale
svale

Reputation: 284

You can use the layout option, like this:

{
  title: "Tags",
  name: "tags",
  type: "array",
  of: [{type: "string"}],
  options: {
    layout: "tags"
  }
}

There was an error in the docs. This is now documented here: https://www.sanity.io/docs/schema-types/array-type#options Thank you for bringing this to our attention!

Upvotes: 8

Related Questions