Refine AI
This is documentation for Refine 4.xx.xx, which is no longer actively maintained.
For up-to-date documentation, see the latest version (5.xx.xx).
Version: 4.xx.xx
Swizzle Ready
Text
This field lets you show basic text. It uses Chakra UI's <Text> component.
Good to know:
You can swizzle this component to customize it with the Refine CLI
Usage
Let's see how to use it in a basic show page:
localhost:3000/posts/show/123
Live previews only work with the latest documentation.
import { useShow } from "@refinedev/core";
import {
  Show,
  TextField,
} from "@refinedev/chakra-ui";
import { Heading } from "@chakra-ui/react";
const PostShow: React.FC = () => {
  const { queryResult } = useShow<IPost>();
  const { data, isLoading } = queryResult;
  const record = data?.data;
  return (
    <Show isLoading={isLoading}>
      <Heading as="h5" size="sm">
        Id
      </Heading>
      <TextField value={record?.id} />
      <Heading as="h5" size="sm">
        Title
      </Heading>
      <TextField value={record?.title} />
    </Show>
  );
};
interface IPost {
  id: number;
  title: string;
}
Was this helpful?
API Reference
Properties
| Property | Type | Description | 
|---|---|---|
value ﹡  |  | The value of the field.  | 
External Props:
It also accepts all props of Chakra UI's Text component.
Was this helpful?