Build your React-based CRUD applications, without constraints. An open source, headless web application framework developed with flexibility in mind.
What is refine?
refine is a React-based framework for the rapid โจ development of web applications.
It eliminates repetitive tasks demanded by CRUD operations and provides industry standard solutions for critical parts like authentication, access control, routing, networking, state management, and i18n.
refine is headless by design, thereby offering unlimited styling and customization options.
What do you mean by "headless" ?
Instead of being a limited set of pre-styled components, refine is a collection of helper hooks, components, and providers. They are all decoupled from UI components and business logic, so that they never keep you from customizing your UI or coding your own flow.
refine seamlessly works with any custom design or UI framework that you favor. For convenience, it ships with ready-made integrations for Ant Design System, Material UI, Mantine, and Chakra UI.
Use cases
refineย shines on data-intensiveโก applications like admin panels, dashboards and internal tools. Thanks to the built-in SSR support, refineย can also power customer-facing applications like storefronts.
You can take a look at some live examples that can be built using refine from scratch:
๐ Auto-generated CRUD UIs from your API data structure
โ Perfect state management & mutations with React Query
๐ Advanced routing with any router library of your choice
๐ Providers for seamless authentication and access control flows
โก Out-of-the-box support for live / real-time applications
๐ Easy audit logs & document versioning
๐ฌ Support for any i18n framework
๐ช Future-proof, robust architecture
โ๏ธ Built-in CLI with time-saving features
โ Full test coverage
Quick Start
The fastest way to get started with refine is by using the create refine-app project starter tool.
Run the following command to create a new refine project configured with Ant Design System as the default UI framework:
Let's consume a public fake REST API and add two resources (posts, categories) to our project. Replace the contents of src/App.tsx with the following code:
๐ Thanks to refine Inferencer package, it guesses the configuration to use for the list, show, create, and edit pages based on the data fetched from the API and generates the pages automatically.
Now, you should see the output as a table populated with post & category data:
You can get the auto-generated pages codes by clicking the Show Code button on each page. Afterward, simply pass the pages to the resources array by replacing with the Inferencer components.
Next Steps
๐ Jump to Tutorial to continue your work and turn the example into a full-blown CRUD application.
If you have any doubts related to the project or want to discuss something, then join our Discord Server.
Our โฅ๏ธ Contributors
License
Licensed under the MIT License, Copyright ยฉ 2021-present Refinedev
v3.97.0
What's Changed
Features
Added swizzle support for @pankod/refine-core package
The swizzle is a command in refine-cli that allows you to customize the Refine's supported components and data providers. It allows you to eject selected files from the Refine packages and modify depending on your needs.
0767d7a07a7 Thanks @yildirayunlu! - Added the useInfiniteList hook ๐ฅณ. This hook is a modified version of react-query's useInfiniteQuery used for retrieving items from a resource with pagination, sort, and filter configurations.
Added support for experimental appDir option in next.config.js to allow for the latest Next.js features.
pages directory
Current support for pages directory has not changed and will continue to work as before. It will be supported as long as Next.js continues to support and prompts it as the stable way of working with Next.js.
appDir option
appDir option is a new experimental feature in Next.js that introduces a bunch of new features. It is currently in beta and is not stable. It is not recommended to use it in production. But can be used alongside the current pages directory support.
To use appDir option, you need to add it to your next.config.js file.
We've needed to make some changes to the @pankod/refine-nextjs-router to make it work with the current structure of the app directory feature. To make sure these do not break the current support for pages directory, we've added a new exports at the sub path @pankod/refine-nextjs-router/app that can be used with the appDir option.
Note
To make optional catch-all routes to work with the app directory, you need to define them as directories unlike the option of defining them as files with pages directory.
You need to use NextRouteComponent from @pankod/refine-nextjs-router/app instead of NextRouteComponent from @pankod/refine-nextjs-router when using appDir option.
Inside your layout file, you need to bind params to routerProvider to make sure @pankod/refine-nextjs-router can work properly with the new structure.
Please note that, unlike the routerProvider from the @pankod/refine-nextjs-router, routerProvider from @pankod/refine-nextjs-router/app is a function and you need to bind params to make it work properly.
You need to add "use client"; directive to both layout.tsx and page.tsx inside app/[[...refine]] directory.
Warning
checkAuthentication does not work with appDir. We're aiming to release a substitute for it using middleware but for now its not included in this release.
Patch Changes
#3436ea74f3a8408 Thanks @sevkioruc! - Fix useList, useCustom and useCustomMutation hooks i18n issue in the error messages.
#33249bfb34749bc Thanks @aliemir! - Added the ability to pass mutation options to useMutation hooks in mutation hooks:
useForm
useStepsForm
useModalForm
useDrawerForm
๐ช Migrating your project automatically with Codemod โจ
@pankod/refine-codemod package handles the breaking changes for your project automatically, without any manual steps. It migrates your @pankod/refine-antd version from 3.x.x to 4.x.x.
Just cd into root folder of your project (where package.json is contained) and run this command:
npx @pankod/refine-codemod antd4-to-antd5
And it's done. Now your project uses @pankod/refine-antd@4.x.x.
FAQs
refine is a React-based framework for building internal tools, rapidly. It ships with Ant Design System, an enterprise-level UI toolkit.
The npm package @pankod/refine-core receives a total of 722 weekly downloads. As such, @pankod/refine-core popularity was classified as not popular.
We found that @pankod/refine-core demonstrated a not healthy version release cadence and project activity because the last version was released a year ago.ย It has 7 open source maintainers collaborating on the project.
Package last updated on 23 Jan 2023
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
A malicious npm package disguised as a WhatsApp client is exploiting authentication flows with a remote kill switch to exfiltrate data and destroy files.
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.