Custom Mantine <List>
How can I use a <Grid> from Mantine instead of a table to display my data in a <List>?
8 Replies
Hi @theswarm420. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
----------------------
Hmm, I don't know enough to give you a confident answer yet. The provided extracts do not contain information on how to use a
<Grid>
from Mantine to display data in a <List>
. However, you can refer to the refine documentation (https://refine.dev/docs) or the Mantine documentation (https://mantine.dev/) for more detailed information.
----------------------
Note: you can ask me a follow up question by @ mentioning me again
:speech_balloon:
----------------------<@1117289843584671775> kapa.ai is still learning and improving, please let us how it did by reacting below
eastern-cyan•14mo ago
@kapa.ai How can I access
resource
data in a custom page?Let me check the knowledge base for you. One moment! :books:
----------------------
You can access
resource
data in a custom page by using the resource
prop in the component you are using. This is applicable for <Create>
, <Show>
, and <List>
components in refine. Here are examples for each:
For a <Create>
component:
Source (https://refine.dev/docs/api-reference/mui/components/basic-views/create)
For a <Show>
component:
Source (https://refine.dev/docs/api-reference/mui/components/basic-views/show)
For a <List>
component:
Source (https://refine.dev/docs/api-reference/mantine/components/basic-views/list)
You can also use the useShow
hook to access resource
data:
Source (https://refine.dev/docs/api-reference/core/hooks/show/useShow)
Remember to replace "posts"
or "categories"
with the name of your actual resource.
----------------------
Note: you can ask me a follow up question by @ mentioning me again
:speech_balloon:
----------------------<@1117289843584671775> kapa.ai is still learning and improving, please let us how it did by reacting below
eastern-cyan•14mo ago
@kapa.ai How do I display the data from the resource?
Let me check the knowledge base for you. One moment! :books:
----------------------
To display data from a resource, you can use the
useList
hook provided by refine. This hook fetches the data from the API and provides it in a format that can be easily used in your components.
Here's an example of how you can use it:
In this example, useList
is used to fetch data from the "posts" resource. The isLoading
variable can be used to display a loading state while the data is being fetched. Once the data is available, it can be accessed through the data
variable and used to display the posts.
Please note that the structure of the data depends on your API. In this example, it's assumed that each post has an id
, title
, and body
.
For more information, you can refer to the refine documentation (https://refine.dev/docs/api-reference/core/hooks/list/useList).
----------------------
Note: you can ask me a follow up question by @ mentioning me again
:speech_balloon:
----------------------<@1117289843584671775> kapa.ai is still learning and improving, please let us how it did by reacting below