The Sanity engineering blog is live. Deep dives from our engineers.

Asset source for Fiona placeholders

Studio v2
This plugin only works with an older version of Sanity Studio (v2), which is deprecated.

Generate a sample of random fiona shapes that you can use for placeholders.

v2 install command (deprecated)

sanity install asset-source-fiona-placeholder

Fiona Placeholder (Asset Source)

Installation

  • sanity install asset-source-fiona-placeholder

Usage

Then you should be able to use in your model as follows...

... in your schema file, import the source asset

import FionaPlaceholder from "part:sanity-plugin-asset-source/fiona-placeholder";

... in your schema define the FionaPlaceholder as an image source

{
  name: "name",
  type: "image",
  options: {
    sources: [FionaPlaceholder]
  }
}

Now when you go to select an image, it should present you with a buffet of brightly coloured placeholder images.

screenshot-1

The images are gerated as SVG images that are then base64 encoded as a url. The image generation is done by Fiona - your friendly pseudo random data generating library: https://fiona.now.sh/examples/image-placeholders/