Sanity Library Reference Docs
    Preparing search index...
    • Returns the current view.

      Throws when the component does not render in a Dashboard view.

      Returns
          | ApplicationInterfaceBase & {
              metadata: ApplicationInterfacePlacementMetadata
              | null;
              type: "panel";
          }
          | ApplicationInterfaceBase & { metadata: null; type: "asset_source" }
          | ApplicationInterfaceBase & {
              metadata: { order?: number; size: "small" | "large" | "banner" };
              type: "tile";
          }

      function ViewTitle() {
      const view = useView()
      return <h2>{view.title}</h2>
      }