Skip to main content
Version: 3.xx.xxSwizzle Ready

Url

This field lets you embed a link. It uses Ant Design's <Typography.Link> component. You can pass a URL in its value prop and you can show a text in its place by passing any children.

Swizzle

You can swizzle this component to customize it with the refine CLI

Usage

Let's see how we can use <UrlField> with an example:

http://localhost:3000
Live previews only work with the latest documentation.
import {
List,
Table,
useTable,
UrlField,
} from '@pankod/refine-antd'

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

return (
<List>
<Table {...tableProps} rowKey="id">
<Table.Column dataIndex="title" title="Title" key="title" width="50%" />
<Table.Column
dataIndex={['image', '0', 'url']}
title={'Image'}
key="image"
render={(value: string) => <UrlField value={value} />}
width="50%"
/>
</Table>
</List>
)
}

interface IPost {
id: number
title: string
image: IImage[]
}

interface IImage {
url: string
}

API Reference

Properties

External Props

It also accepts all props of Ant Design Link.