zenui-labs/zenui-library-react
Über uns
ZenUI component library designed for React. The library is optimized for performance, easy to integrate, and requires no dependencies.
Web und AppsGemessener Sternzuwachs
- in 24h
- 0
- in 7 days
- 0
- in 15 days
- Verlauf wird gesammelt
- in 1 month
- Verlauf wird gesammelt
Nettoänderungen in überlappenden Zeiträumen, keine Tagessummen. Fehlende Messwerte bleiben leer. Sterne zeigen Interesse, nicht Qualität.
README.md
OriginalZenUI Library React
Free, open source React components built with Tailwind CSS.
Copy a component into your project, pass it your data, and ship.
reactui.zenui.net · Installation · What's new in v4
ZenUI v4
v4 rebuilds the library around reusable, typed components.
- Reusable components. Every example comes in two files: the component, with typed props and no demo data, and a short usage file that shows which props to pass. Paste the component once and give it your own data.
- TypeScript first, JavaScript on request. Every example is written in TypeScript. Switch any code block to JS to get the same component with the types removed.
- 691 examples across 134 pages of components, animations and blocks, from inputs and tables to pricing sections, dashboards and animated charts.
- Responsive testing. Open any preview full screen and drag its edges, or jump to phone, tablet and desktop widths.
- Light and dark in every preview. Switch one preview between auto, light and dark, change its background, or replay its animation.
- A redesigned site, docs and tools, with dark as the default theme.
Components copied from v3 keep working, so there is nothing to migrate. Older versions stay online at v3.reactui.zenui.net and v2.reactui.zenui.net.
Using a component
1. Set up your project
ZenUI is not a package. You need a React 18 project with Tailwind CSS v3, plus the two libraries most examples use:
npm install framer-motion react-icons
A few examples use another package, and their page says so at the top (for example the slider needs swiper).
For dark mode, set darkMode: "class" in tailwind.config.js and toggle a dark class on <html>. If your project is
light only, turn off Copy with dark: above the code and the dark: classes are left out.
2. Copy the component
Open a page on reactui.zenui.net, switch an example to Code, and copy the first file into
your project, for example src/components/ui/KpiCards.tsx. Pick TS or JS above the code first.
3. Pass your data
The second tab, Usage.tsx, shows how to use it:
import {KpiCards, type Kpi} from "./components/ui/KpiCards";
const kpis: Kpi[] = [
{label: "Monthly recurring revenue", value: "$84,120", change: 12.4, series: [52, 54, 58, 61, 64, 68, 71, 76]},
{label: "Churn rate", value: "1.8%", change: -0.6, lowerIsBetter: true, series: [3.1, 2.9, 2.6, 2.4, 2.2, 2, 1.9, 1.8]},
];
export default function Dashboard() {
return <KpiCards items={kpis}/>;
}
Components follow the same conventions:
- Data is passed in through required props, typed with exported interfaces such as
Kpi,PlanorFeature. - Headings, labels and captions have defaults you can override.
- State a parent may care about (the selected tab, a range, an open drawer) can be controlled with
valueandonChange, or left to the component withdefaultValue. - User actions have callbacks such as
onSelectoronSubmit. - The root element accepts
className. - Useful parts are exported on their own, for example a single card from a card grid.
Everything else is plain Tailwind CSS, so you can change any class after you paste it. In Next.js App Router, add
"use client" to the top of components that use state or effects.
What's in the library
Components. 363 examples on 73 pages: inputs, buttons, navigation, overlays, feedback, data display, charts, cards, e-commerce and more.
Animations. 182 examples on 35 pages: text effects, scroll animations, cursor effects, tilt and flip cards, docks, animated beams, charts, number tickers and micro-interactions, built with Framer Motion. They respect reduced motion settings.
Blocks. 146 examples on 26 pages: hero, feature, pricing, FAQ, testimonial, team, blog, CTA and footer sections, sign in and sign up screens, dashboards, checkout pages and more.
Tools. ShortKey (keyboard shortcut handlers), color palette and opacity steps, color from image, 400+ SVG icons, Config AI (a Tailwind CSS theme from a description) and Semantic TagMaster.
Templates and resources. Website templates and a list of programming resources.
Working on the site
Clone and run it:
git clone https://github.com/zenui-labs/zenui-library-react.git
cd zenui-library-react
npm install
npm run dev
The site is written in TypeScript with Vite, React 18 and Tailwind CSS v3.
| Command | What it does |
|---|---|
npm run dev |
Start the dev server. |
npm run build |
Production build. |
npm run preview |
Serve the production build locally. |
npm run typecheck |
Type-check the whole project with tsc. |
node scripts/typecheck-dir.mjs <folder> |
Type-check one folder and what it imports. Faster while you work. |
node scripts/check-snippets.mjs [folder] |
Compile every copyable code example in strict TypeScript, as if pasted into a new project. |
Adding examples
Component, animation and block pages live in src/Examples/<components|animations|blocks>/<slug>/:
<Name>.tsxis the reusable component: named exports, typed props, no demo data.<Name>.example.tsxis the usage. It imports the component from"./<Name>", passes it demo data, and is what the preview renders.index.tslists the examples with their id, title, description, the component and both sources (files: [{name: "<Name>.tsx", source}]).
Register the page in that section's pages.ts and it appears in the routes, sidebar, search and pager. A page can set a
notice (for example a package to install) and unlisted: true to stay out of the sidebar.
Examples may only import react, framer-motion, react-icons and packages their page names in a notice, so they
work when pasted into a new project. Before opening a pull request, run check-snippets on your folder: it compiles
each usage file together with the component it imports, so a prop change that breaks the usage is caught.
The JavaScript version of every example is generated in the browser from the TypeScript source with Sucrase, so there is only one version to maintain.
Deploying
The site builds to static files with npm run build. Config AI needs VITE_GROQ_API_KEY set in the build
environment. Because it is a VITE_ variable, the key ends up in the client bundle, so use a key with a spending limit
or move the call to a server function.
Sell your template through ZenUI
Creators can sell React, Next.js and Tailwind CSS templates on ZenUI Library and earn 80% of each sale. Read the template submission guide for guidelines, submission steps and earnings.
Support ZenUI
ZenUI is free. If it saves you time, you can support its development on Ko-fi.
Contributing
Contributions are welcome. See CONTRIBUTING.md.
License
MIT. See LICENSE.md.
Connect with ZenUI
Ähnliche Projekte entdecken
Wird geladen…
