Installation
Install @devup-ui/react
Install the package in your project directory with npm.
1npm install @devup-ui/react1npm install @devup-ui/react
Using Devup UI with Next.js
If you are using Next.js, you can install the Next.js plugin.
1npm install @devup-ui/next-plugin1npm install @devup-ui/next-plugin
After installing the plugin, you can use the plugin in your Next.js project.
1// next.config.js 2 3import { DevupUI } from '@devup-ui/next-plugin' 4 5export default DevupUI({})1// next.config.js 2 3import { DevupUI } from '@devup-ui/next-plugin' 4 5export default DevupUI({})
Using Devup UI with Vite
If you are using Vite, you can install the Vite plugin.
1npm install @devup-ui/vite-plugin1npm install @devup-ui/vite-plugin
After installing the plugin, you can use the plugin in your Vite project.
1import { DevupUI } from '@devup-ui/vite-plugin' 2import react from '@vitejs/plugin-react' 3import { defineConfig } from 'vite' 4 5export default defineConfig({ 6 plugins: [react(), DevupUI()], 7})1import { DevupUI } from '@devup-ui/vite-plugin' 2import react from '@vitejs/plugin-react' 3import { defineConfig } from 'vite' 4 5export default defineConfig({ 6 plugins: [react(), DevupUI()], 7})
If you have developed a UI library using Devup UI, you can use the library mode.
1import { DevupUI } from '@devup-ui/vite-plugin' 2import react from '@vitejs/plugin-react' 3import { defineConfig } from 'vite' 4 5export default defineConfig({ 6 plugins: [ 7 react(), 8 DevupUI({ 9 // no extract css 10 extractCss: false, 11 }), 12 ], 13})1import { DevupUI } from '@devup-ui/vite-plugin' 2import react from '@vitejs/plugin-react' 3import { defineConfig } from 'vite' 4 5export default defineConfig({ 6 plugins: [ 7 react(), 8 DevupUI({ 9 // no extract css 10 extractCss: false, 11 }), 12 ], 13})
In library mode the published code still holds the Devup UI components and is compiled by the application that uses it. Packages in node_modules are skipped unless they are listed in include, so the application must list your library there, or its components stay uncompiled:
1DevupUI({
2 include: ['your-ui-library'],
3})
1DevupUI({
2 include: ['your-ui-library'],
3})
Using Devup UI with Rsbuild
If you are using rsbuild, you can install the rsbuild plugin.
1npm install @devup-ui/rsbuild-plugin1npm install @devup-ui/rsbuild-plugin
After installing the plugin, you can use the plugin in your rsbuild project.
1// rsbuild.config.mjs 2 3import { DevupUIRsbuildPlugin } from '@devup-ui/rsbuild-plugin' 4import { defineConfig } from '@rsbuild/core' 5import { pluginReact } from '@rsbuild/plugin-react' 6 7export default defineConfig({ 8 plugins: [pluginReact(), DevupUIRsbuildPlugin()], 9})1// rsbuild.config.mjs 2 3import { DevupUIRsbuildPlugin } from '@devup-ui/rsbuild-plugin' 4import { defineConfig } from '@rsbuild/core' 5import { pluginReact } from '@rsbuild/plugin-react' 6 7export default defineConfig({ 8 plugins: [pluginReact(), DevupUIRsbuildPlugin()], 9})
Using Devup UI with Webpack
If you are using Webpack directly, you can install the Webpack plugin.
1npm install @devup-ui/webpack-plugin1npm install @devup-ui/webpack-plugin
Add the plugin to your Webpack configuration.
1// webpack.config.js 2 3import { DevupUIWebpackPlugin } from '@devup-ui/webpack-plugin' 4 5export default { 6 plugins: [new DevupUIWebpackPlugin()], 7}1// webpack.config.js 2 3import { DevupUIWebpackPlugin } from '@devup-ui/webpack-plugin' 4 5export default { 6 plugins: [new DevupUIWebpackPlugin()], 7}
Using Devup UI with Bun
If you are using Bun as the bundler, install the Bun plugin with Devup UI.
1bun add @devup-ui/react @devup-ui/bun-plugin1bun add @devup-ui/react @devup-ui/bun-plugin
Pass the plugin to Bun.build.
1// build.ts 2 3import { DevupUI } from '@devup-ui/bun-plugin/register' 4 5await Bun.build({ 6 entrypoints: ['./src/index.tsx'], 7 outdir: './dist', 8 plugins: [DevupUI()], 9})1// build.ts 2 3import { DevupUI } from '@devup-ui/bun-plugin/register' 4 5await Bun.build({ 6 entrypoints: ['./src/index.tsx'], 7 outdir: './dist', 8 plugins: [DevupUI()], 9})
Bun.build only runs the plugins in its plugins list. Importing @devup-ui/bun-plugin registers a runtime plugin instead: it compiles the files Bun loads at runtime, such as in bun test, but not the files Bun.build bundles. For tests, preload it:
1# bunfig.toml 2[test] 3preload = ["@devup-ui/bun-plugin"]1# bunfig.toml 2[test] 3preload = ["@devup-ui/bun-plugin"]
License Banner
Every stylesheet Devup UI emits starts with a
/*! devup-ui v… | Apache License 2.0 | https://devup-ui.com */ comment, which
minifiers keep. It is on by default. Every build plugin takes a
licenseBanner option; licenseBanner: false drops the banner from every
stylesheet. A stylesheet without any rule is emitted empty, banner included.
1// next.config.ts
2export default DevupUI(nextConfig, { licenseBanner: false })
3
4// vite.config.ts
5DevupUI({ licenseBanner: false })
6
7// rsbuild.config.ts
8DevupUIRsbuildPlugin({ licenseBanner: false })
9
10// webpack.config.js
11new DevupUIWebpackPlugin({ licenseBanner: false })
12
13// build.ts (Bun)
14DevupUI({ licenseBanner: false })
1// next.config.ts
2export default DevupUI(nextConfig, { licenseBanner: false })
3
4// vite.config.ts
5DevupUI({ licenseBanner: false })
6
7// rsbuild.config.ts
8DevupUIRsbuildPlugin({ licenseBanner: false })
9
10// webpack.config.js
11new DevupUIWebpackPlugin({ licenseBanner: false })
12
13// build.ts (Bun)
14DevupUI({ licenseBanner: false })