Skip to main content
Version: 2.xx.xx

Tag

This field lets you display a value in a tag. It uses Ant Design's <Tag> component.

Usage​

Let's see how we can use it in a basic list page:

pages/posts/list.tsx
import {
List,
TagField,
Table,
useTable,
IResourceComponentsProps,
} from "@pankod/refine";

export const PostList: React.FC = () => {
const { tableProps } = useTable<IPost>();

return (
<List>
<Table {...tableProps} rowKey="id">
<Table.Column dataIndex="title" title="title" />
<Table.Column
dataIndex="status"
title="status"
render={(value: string) => <TagField value={value} />}
/>
</Table>
</List>
);
};

interface IPost {
title: string;
status: "published" | "draft" | "rejected";
}

TagField

API Reference​

Properties​

PropertyDescriptionType
valueTag contentReact.ReactNode

Refer to the documentation for rest of Link props β†’