API Reference
Advanced Tutorials
Comparison
FAQ
Contributing
Testing
Migration Guide
Licence
This is documentation for Refine 3.xx.xx, which is no longer actively maintained.
For up-to-date documentation, see the latest version (4.xx.xx).
Version: 3.xx.xx
Swizzle Ready
Import
<ImportButton>
is compatible with the useImport
hook and is meant to be used as it's upload button.
It uses Ant Design's <Button>
and <Upload>
components. It wraps a <Button>
component with an <Upload>
component and accepts properties for <Button>
and <Upload>
components separately.
Swizzle
You can swizzle this component to customize it with the refine CLI
Usage
localhost:3000
Live previews only work with the latest documentation.
import {
List,
Table,
useTable,
useImport,
ImportButton,
} from "@pankod/refine-antd";
const PostList: React.FC = () => {
const { tableProps } = useTable<IPost>();
const importProps = useImport<IPostFile>();
return (
<List
headerButtons={
<ImportButton {...importProps} />
}
>
<Table {...tableProps} rowKey="id">
<Table.Column dataIndex="id" title="ID" />
<Table.Column dataIndex="title" title="Title" />
</Table>
</List>
);
};
interface IPost {
id: number;
title: string;
}
interface IPostFile {
title: string;
categoryId: number;
}
Was this helpful?
Properties
hideText
It is used to show and not show the text of the button. When true
, only the button icon is visible.
localhost:3000
Live previews only work with the latest documentation.
import { ImportButton, useImport } from "@pankod/refine-antd";
const MyImportComponent = () => {
const importProps = useImport();
return (
<ImportButton
{...importProps}
hideText
/>
);
};
Was this helpful?
API Reference
Properties
Was this helpful?