Skip to content

rtCamp/frappe-ui-react

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Frappe UI React

ESLint Prettier License

Frappe UI React is a modern component library designed for building frontend applications in React, specifically tailored for the Frappe Framework. It is inspired by the original frappe-ui, which is created in Vue, offering a similar components and aesthetic in React. However, we are not limited to a one-to-one port and also provide a growing collection of custom-built components to give developers more power and flexibility.

Prerequisites

  • Node.js v20
  • TailwindCSS v4

Usage

You can set up frappe-ui-react in the following simple steps, or you can quickly setup frappe-ui-react using frappe-ui-react-starter.

Step 1: Installation

Install the package using npm.

npm install @rtcamp/frappe-ui-react

Step 2: Configuration

Import the theme CSS directly into your project (e.g., in index.css) and provide the source of the frappe-ui-react package so that it picks the styles automatically.

@import '@rtcamp/frappe-ui-react/theme';
@source "../../node_modules/@rtcamp/frappe-ui-react/dist";

(Tailwind v3 usage):

If you are already using a Tailwind v3 configuration, you should take two steps:

  • Import the theme-v3 CSS into your index.css file, and ensure that index.css is then imported in your index.tsx.

  • Import the Tailwind configuration from frappe-ui-react and either use it as a preset or extend your existing configuration.

/* index.css */
@import '@rtcamp/frappe-ui-react/theme-v3';
// tailwind.config.js in your project
module.exports = {
  presets: [
    require('@rtcamp/frappe-ui-react/tailwind/preset')
  ],
  content: [
    path.resolve(__dirname, "../../node_modules/@rtcamp/frappe-ui-react/dist")
  ]
  // Additional configuration...
}

Step 3: Import and Use Components

You can now import components and use them in your project.

import './index.css';
import { Button } from "@rtcamp/frappe-ui-react";

function App() {
  return (
    <div className="app-container">
      <Button 
        label="Default Button"
        theme="gray"
        size="md"
        variant="subtle" 
      />
    </div>
  );
}

export default App;

Under the Hood

This library is built on top of several excellent open-source projects:

  • TailwindCSS: Utility-first CSS framework for building design system-based UIs.
  • Headless UI: Unstyled and accessible UI components.
  • Radix UI: Low-level, unstyled, and accessible UI primitives.
  • React Quill: Rich text editor component for React.
  • dayjs: Lightweight JavaScript library for working with dates.

Inspiration & Credits

This project, Frappe UI React, is heavily inspired by the original Frappe UI project. Frappe UI is a fantastic Vue.js component library, and our goal with Frappe UI React is to bring a similar aesthetic and component experience to the React ecosystem.

About

A frappe react components library

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 5

Languages