Hey all, I'm trying to use a custom (svg file) icon in the structure builder but I don't really know how to implement it. Can someone give me some tips?

2 replies
Last updated: Dec 7, 2020
Hey all, I'm trying to use a custom (svg file) icon in the structure builder but I don't really know how to implement it. Can someone give me some tips?
Dec 7, 2020, 12:37 PM
something like this?

const MyIcon = () => (
  <svg>
    ...
  </svg>
);

export default () =>
  S.list()
    .title("Hello")
    .items([
      S.listItem()
        .title("Hello")
        .icon(() => <MyIcon />)
Dec 7, 2020, 12:56 PM
awesome thanks, if that works, its exactly what i was looking for
Dec 7, 2020, 1:05 PM

Sanity.io – build remarkable experiences at scale

Sanity is a customizable solution that treats content as data to power your digital business. Free to get started, and pay-as-you-go on all plans.

Categorized in