Sanity Library Reference Docs
    Preparing search index...

    Interface AssetSourceComponentProps

    interface AssetSourceComponentProps {
        accept: string;
        action?: AssetSourceComponentAction;
        assetSource: AssetSource;
        assetToOpen?: Asset;
        assetType?: "image" | "file" | "sanity.video";
        dialogHeaderTitle?: ReactNode;
        onChangeAction?: (action: AssetSourceComponentAction) => void;
        onClose: () => void;
        onSelect: (assetFromSource: AssetFromSource[]) => void;
        schemaType?: FileSchemaType | ImageSchemaType;
        selectedAssets: Asset[];
        selectionType: "single";
        uploader?: AssetSourceUploader;
    }
    Index

    Properties

    accept: string
    assetSource: AssetSource
    assetToOpen?: Asset

    The asset to open in source. Only provided when action is 'openInSource'.

    assetType?: "image" | "file" | "sanity.video"
    dialogHeaderTitle?: ReactNode
    onChangeAction?: (action: AssetSourceComponentAction) => void
    onClose: () => void
    onSelect: (assetFromSource: AssetFromSource[]) => void
    selectedAssets: Asset[]
    selectionType: "single"

    The uploader instance for tracking upload progress.

    When action is 'upload':

    • If uploader is provided: Picker mode. Files are available via uploader.getFiles(). The source should upload these files and report progress via the uploader.
    • If uploader is undefined: Component mode. The source should show its own file selection UI, handle uploads internally, and call onSelect when complete.