Studio

Icons

Use icons for types to display in the creation dialogue and when you're missing an media preview.

Icons

Use icons for types to display in the creation dialogue and when you're missing a media preview.

Helpful icons can improve the editorial experience, and can be applied in several contexts throughout the studio interface, such as in structures created in Structure Builder, and as tool icons in the Portable Text Editor.

Each document type can also be assigned an icon to illustrate its purpose. We recommend using an SVG file, but it can be any react component you like.

If you want to have your icons reflect the default style found throughout the Studio, you might opt to install the @sanity/icons package. Another popular package is react-icons which includes a plethora of open source SVG icons from collections like Font Awesome, Material Design, Typicons, and Github Octicons.

Protip

Example

Install the icon package using your favorite package manager, and use them in your schemas! Just remember that any schema file with icons in them should have a .jsx or .tsx extension.

Example

After including @sanity/icons in your package.json with yarn add @sanity/icons you can add it to your schema:

import { PlayIcon } from '@sanity/icons/Play'

export default {
  name: 'movie',
  type: 'document',
  icon: PlayIcon,
  fields: [
    {
      title: 'Title',
      name: 'title',
      type: 'string'
    },
    {
      title: 'Release Date',
      name: 'releaseDate',
      type: 'date'
    }
  ],
  preview: {
    select: {
      title: 'title',
      subtitle: 'releaseDate'
    }
  }
}
Here we've added unique icons for each of our document types Movie, Person, Screening.

Update icon imports for @sanity/icons v5

Version 5 of @sanity/icons no longer exports individual icons from the package root. Each icon has its own subpath, named after the icon without the Icon suffix. For example, import EditIcon from @sanity/icons/Edit. Sanity Studio 6.4.0 and later depend on @sanity/icons v5.

Imports of individual icons from the package root fail in version 5. Update each one to import from the icon's subpath:

import {EditIcon, TrashIcon} from '@sanity/icons'

Subpath imports work in version 4.1.0 and later, so you can update your imports before you upgrade. Every icon from version 3 is available under its subpath in version 5.

There's no codemod for this change. To update single-icon imports in bulk, use a regular expression find and replace in your code editor:

import \{\s*(\w+)Icon\s*\} from ['"]@sanity/icons['"]

The pattern doesn't match imports that list more than one icon. Split those into one import per icon first.

The package root still exports the Icon component and the icons map. To choose an icon by name at runtime, pass its kebab-case name to Icon as symbol:

import {Icon} from '@sanity/icons'

export function EditStatusIcon() {
  return <Icon symbol="edit" />
}

If your project installs @sanity/ui directly, upgrade it to version 3.4.0 or later. Earlier versions of @sanity/ui depend on @sanity/icons v3.

Was this page helpful?

Sanity logosanity.ioAll Systems Operational© Sanity 2026
Change site theme