Socket
Socket
Sign inDemoInstall

@pankod/refine-ui-types

Package Overview
Dependencies
3
Maintainers
7
Versions
26
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @pankod/refine-ui-types

refine is a React-based framework for building internal tools, rapidly. It ships with Ant Design System, an enterprise-level UI toolkit.


Version published
Weekly downloads
1.3K
increased by12%
Maintainers
7
Install size
17.7 MB
Created
Weekly downloads
 

Readme

Source



refine is a React-based framework for building internal tools, rapidly. ✨ It ships with Ant Design System, an enterprise-level UI toolkit.

Discord Twitter Follow

refine - 100% open source React framework to build web apps 3x faster | Product Hunt

Awesome Maintainability Test Coverage npm version npm Contributor Covenant

Created by refine

About

refine offers lots of out-of-the box functionality for rapid development, without compromising extreme customizability. Use-cases include, but are not limited to admin panels, B2B applications and dashboards.

Documentation

For more detailed information and usage, refer to the refine documentation.

What is refine?

refine is a React-based framework for building internal tools, rapidly. :sparkles: It ships with Ant Design System, an enterprise-level UI toolkit.

Refine offers lots of out-of-the box functionality for rapid development, without compromising extreme customizability. Use-cases include, but are not limited to admin panels, B2B applications and dashboards.

What is a "headless" Framework?

refine is a headless React framework, which means all out-of-the-box features(Routing, Networking, Authentication, Authorization, State Management, Realtime, i18n, etc.), it can be used without being tied to any UI elements or framework. Also, Ant Design as out-of-the-box is supported.

  • Customization & Extensibility - UI is a completely customizable area and each developer uses different solutions. refine features does not restrict or interfere with your UI structure. refine allows the you to design and customizable the UI based on their unique use case.

  • Separation of Concerns - refine as a framework, is not responsible for your UI and is independent.

  • Maintenance - By removing the API surface to support every UI use case, refine easy to use and update/maintain is simple.

Key features

🔥 Headless : Works with any UI framework

⚙️ Zero-configuration: One-line setup with superplate. It takes less than a minute to start a project.

📦 Out-of-the-box : Routing, networking, authentication, state management, i18n and UI.

🔌 Connectors for 15+ backend services including REST API, GraphQL, NestJs CRUD, Airtable, Strapi, Strapi v4, Strapi GraphQL, Supabase, Hasura, Appwrite, Firebase, and Directus.

📝 Native Typescript Core : You can always opt out for plain JavaScript.

🐜 Enterprise UI : Works seamlessly with Ant Design System. (Support for multiple UI frameworks is on the Roadmap)

📝 Boilerplate-free Code : Keeps your codebase clean and readable.

Motivation

Higher-level frontend frameworks can save you a lot time, but they typically offer you a trade-off between speed and flexibility.

After many years of experience in developing B2B frontend applications and working with popular frameworks, we came up with a new approach to tackle this dilemma. This is how refine is born.

refine is a collection of helper hooks, components and providers. They are all decoupled from your UI components and business logic, so they never keep you from customizing your UI or coding your own flow.

As refine is totally unopinionated about UI and logic, it's strongly opinionated about three parts of your application:

  1. API Networking
  2. State Management
  3. Authentication & Authorization

We believe, these are the most important components of a data-intensive frontend application and should be handled in a robust way by leveraging industry best practices.

refine guarantees you a perfect implementation of these building blocks in your project, so you can focus on your development.

Architecture

refine makes extensive use of hooks as a default way for interacting with your components. Under the hood, refine relies heavily to React Query for data handling, caching and state management. Access to external sources and API's happen via providers which are basically plug-in type components for extendibility.


Benchmark

After releasing the first internal versions, we had the chance to migrate some of our React projects to refine. In addition to shorter development times and overall performance gains, we've measured significant reduction in project size.

refine makes your codebase significantly smaller, by eliminating redundant code such as reducers, actions and unit tests. Below is a size comparison for an example project:


Quick Start

Run the create refine-app CLI tool with the following command:

npm create refine-app@latest tutorial

Follow the CLI wizard to select options and start creating your project.

After setup is complete, navigate to the project folder and start your project with:

npm run dev

Your refine application will be accessible at http://localhost:3000.

Replace the contents of App.tsx with the following code:

import React from "react";
import { Refine, useOne } from "@pankod/refine-core";
import {
    Layout,
    ErrorComponent,
    LightTheme,
    ThemeProvider,
    notificationProvider,
    RefineSnackbarProvider,
    CssBaseline,
    GlobalStyles,
} from "@pankod/refine-mui";
import routerProvider from "@pankod/refine-react-router-v6";
import dataProvider from "@pankod/refine-simple-rest";

const App: React.FC = () => {
    return (
        <ThemeProvider theme={LightTheme}>
            <CssBaseline />
            <GlobalStyles styles={{ html: { WebkitFontSmoothing: "auto" } }} />
            <RefineSnackbarProvider>
                <Refine
                    routerProvider={routerProvider}
                    dataProvider={dataProvider(
                        "https://api.fake-rest.refine.dev",
                    )}
                    notificationProvider={notificationProvider}
                    Layout={Layout}
                    catchAll={<ErrorComponent />}
                    resources={[{ name: "posts", list: PostList }]}
                />
            </RefineSnackbarProvider>
        </ThemeProvider>
    );
};

export const PostList: React.FC = () => {
    const getOne = React.useCallback(useOne, []);
    const columns = React.useMemo<GridColumns<IPost>>(
        () => [
            {
                field: "id",
                headerName: "ID",
                type: "number",
                width: 50,
            },
            { field: "title", headerName: "Title", minWidth: 400, flex: 1 },
            {
                field: "category.id",
                headerName: "Category",
                type: "number",
                headerAlign: "left",
                align: "left",
                minWidth: 250,
                flex: 0.5,
                valueGetter: ({ row }) => {
                    const { data } = getOne<ICategory>({
                        resource: "categories",
                        id: row.category.id,
                    });
                    return data?.data.title;
                },
            },
            { field: "status", headerName: "Status", minWidth: 120, flex: 0.3 },
            {
                field: "actions",
                headerName: "Actions",
                renderCell: function render({ row }) {
                    return <EditButton hideText recordItemId={row.id} />;
                },
                align: "center",
                headerAlign: "center",
                minWidth: 80,
            },
        ],
        [getOne],
    );

    const { dataGridProps } = useDataGrid<IPost>({
        columns,
    });

    return (
        <List>
            <DataGrid {...dataGridProps} autoHeight />
        </List>
    );
};

export default App;
interface IPost {
    title: string;
    createdAt: string;
    category: { id: number };
}

interface ICategory {
    id: number;
    title: string;
}

Roadmap

You can find Refine's Public Roadmap here!

Stargazers

Stargazers repo roster for refinedev/refine

Contribution

If you have a bug to report, do not hesitate to file an issue.

If you are willing to fix an issue or propose a feature; all PRs with clear explanations are welcome and encouraged.

License

Licensed under the MIT License, Copyright © 2021-present refine

Special Thanks

React Admin has been a great source of ideas and inspiration for refine. Big thanks to friends at Marmelab for the amazing work they are doing.

FAQs

Last updated on 14 Mar 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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc