Example: Customize the download button

The Download component provided by the Get File plugin has a render prop that allows consumers to use a custom button. Here is the sample code that demonstrates the ability:

import { RenderDownloadProps } from '@react-pdf-viewer/get-file';

const getFilePluginInstance = getFilePlugin();
const { Download } = getFilePluginInstance;

// Your render function
<Download>
{
    (props: RenderDownloadProps) => (
        <button
            style={{
                ...
            }}
            onClick={props.onClick}
        >
            Download
        </button>
    )
}
</Download>

(The sample code)

Related examples