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.
- Node.js v20
- TailwindCSS v4
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.
Install the package using npm.
npm install @rtcamp/frappe-ui-reactImport 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-v3CSS into your index.css file, and ensure thatindex.cssis then imported in yourindex.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...
}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;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.
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.