Skip to content

Commit 581ca53

Browse files
docs: update
1 parent 2088c76 commit 581ca53

File tree

4 files changed

+52
-39
lines changed

4 files changed

+52
-39
lines changed

shadcn-theme-editor/README.md

Lines changed: 49 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,49 @@
11
<div align="center">
2-
<h1 align="center">Shadcn Theme Editor</h1>
3-
<h3>Effortless Shadcn Theme Customization Made Simple.</h3>
4-
<h5>◦ Manage Shadcn theme colors with an intuitive UI.</h5>
52

6-
<p align="center">
3+
# 🎨 Shadcn Theme Editor
4+
5+
**Effortless Shadcn Theme Customization Made Simple**
6+
7+
Manage Shadcn theme colors with an **intuitive UI**, adjust styles in real-time, and keep your design consistent without diving into raw CSS.
8+
9+
---
710

811
![Next.js](https://img.shields.io/badge/Next.js-000000.svg?style&logo=Next.js&logoColor=white)
912
![React](https://img.shields.io/badge/React-61DAFB.svg?style&logo=React&logoColor=black)
1013
![TypeScript](https://img.shields.io/badge/TypeScript-3178C6.svg?style&logo=TypeScript&logoColor=white)
1114

12-
</p>
13-
14-
![git-last-commit](https://img.shields.io/github/last-commit/programming-with-ia/shadcn-theme-editor)
15+
![GitHub last commit](https://img.shields.io/github/last-commit/programming-with-ia/shadcn-theme-editor)
1516
![GitHub commit activity](https://img.shields.io/github/commit-activity/m/programming-with-ia/shadcn-theme-editor)
1617
![GitHub top language](https://img.shields.io/github/languages/top/programming-with-ia/shadcn-theme-editor)
1718

18-
![minified size](https://badgen.net/bundlephobia/min/shadcn-theme-editor@latest)
19-
19+
![npm bundle size](https://badgen.net/bundlephobia/min/shadcn-theme-editor@latest)
2020
[![NPM Version](https://img.shields.io/npm/v/shadcn-theme-editor?logo=npm)](https://www.npmjs.com/package/shadcn-theme-editor)
2121
[![GitHub](https://img.shields.io/badge/shadcn_theme_editor-161b22?logo=github)](https://github.com/programming-with-ia/shadcn-theme-editor)
2222

2323
</div>
2424

2525
---
2626

27-
## 📍 Overview
27+
# 📍 Overview
28+
29+
The **Shadcn Theme Editor** is a lightweight component designed to simplify theme customization in Shadcn projects.
30+
31+
- 🎛 **Visual UI** for adjusting theme colors
32+
-**Real-time preview** of changes
33+
- 🌗 **Supports light & dark mode** via the `html.dark` class
34+
- 🛠 Works seamlessly with Shadcn components
35+
- 📦 Install as a **dev dependency** (recommended, due to bundle size)
2836

29-
Shadcn Theme Editor is a user-friendly component designed to simplify the process of managing and customizing theme colors in Shadcn-based projects. This package provides an intuitive UI with buttons for different color properties, allowing developers to easily adjust and preview theme colors in real-time. Although the package is optimized for ease of use, its build size is substantial, so it is recommended to install it as a development dependency. This tool empowers developers to create consistent, visually appealing themes without diving into complex CSS, making it an essential addition to your Shadcn toolkit.
37+
This makes it a **must-have dev tool** for anyone building with [shadcn/ui](https://ui.shadcn.com/).
3038

3139
---
3240

33-
## 🚀 Getting Started
41+
## 🚀 Installation
3442

3543
There are two ways to install **shadcn-theme-editor**:
3644

37-
1. [**Using npm (installs into `devDependencies`)**](#install-npm)
38-
2. [**Using the Shadcn CLI (adds components directly to your project)**](#install-shadcn-cli)
45+
1. **[Via npm/yarn/pnpm/bun](#install-npm)** (as a dev dependency)
46+
2. **[Via Scaflo CLI](#install-scaflo-cli)** (copies fully editable components)
3947

4048
---
4149

@@ -57,32 +65,35 @@ pnpm add -D shadcn-theme-editor
5765
bun add -D shadcn-theme-editor
5866
```
5967

60-
> This method keeps the package inside `node_modules` and lists it under `devDependencies` in `package.json`.
61-
6268
---
6369

64-
<h3 id="install-shadcn-cli">2️⃣ Install via Shadcn CLI</h3>
70+
<h3 id="install-scaflo-cli">2️⃣ Install via Scaflo CLI</h3>
6571

66-
The Shadcn CLI copies the source components into your project so you can fully customize them.
72+
The [Scaflo CLI](https://github.com/programming-with-ia/scaflo) installs Shadcn Theme Editor as source components into your project, so you can fully customize them.
6773

6874
```bash
6975
# pnpm (recommended)
70-
pnpm dlx shadcn@latest add https://shadcnthemeeditor.vercel.app/r/editor.json
76+
pnpm dlx shadcn@latest add sheet button accordion
77+
pnpm dlx [email protected] https://shadcnthemeeditor.vercel.app/r/editor.json -e %COMPONENTS%/shadcn-theme-editor
7178

7279
# or with npx
73-
npx shadcn@latest add https://shadcnthemeeditor.vercel.app/r/editor.json
80+
npx shadcn@latest add sheet button accordion
81+
npx [email protected] https://shadcnthemeeditor.vercel.app/r/editor.json -e %COMPONENTS%/shadcn-theme-editor
7482

7583
# or with bun
76-
bunx shadcn@latest add https://shadcnthemeeditor.vercel.app/r/editor.json
84+
bunx shadcn@latest add sheet button accordion
85+
bunx [email protected] https://shadcnthemeeditor.vercel.app/r/editor.json -e %COMPONENTS%/shadcn-theme-editor
7786
```
7887

7988
Follow the CLI prompts to generate and configure the components inside your own codebase.
8089

90+
> ⚠️ Note for **Next.js**: Add `"use client";` to `components/shadcn-theme-editor/index.tsx`.
91+
8192
---
8293

8394
## 📖 Usage
8495

85-
**import default and add in `app/layout.tsx` file**
96+
Import the component and add it to your layout:
8697

8798
<!--
8899
> **Tip**
@@ -93,7 +104,8 @@ Follow the CLI prompts to generate and configure the components inside your own
93104
import ShadcnThemeEditor from "shadcn-theme-editor";
94105
```
95106

96-
or (in this way, it doesn't include the component in the production build)
107+
### Load in Development Only
108+
Exclude the editor from production builds:
97109

98110
```tsx
99111
let ShadcnThemeEditor: any;
@@ -115,25 +127,29 @@ and use
115127

116128
</br>
117129

118-
# Screenshots
130+
## 🖼️ Screenshots
119131

120132
<p align="center">
121133
<img align="center" src="https://raw.githubusercontent.com/programming-with-ia/shadcn-theme-editor/master/screenshots/shadcn-theme-editor.png" alt="logo">
122134
</p>
123135

124-
## [How to Use the UI](usage.md)
125-
[usage.md](usage.md)
126-
127-
## Upcoming Features
136+
For detailed UI examples, see: [usage.md](./usage.md)
128137

129-
- use [jln themes](https://ui.jln.dev/) directly in your project
138+
## ⚙️ Props
130139

131-
## Special Thanks
140+
| Prop | Type | Default | Description |
141+
| ------------------ | ------------------------ | -------------------------------- | ------------------------------------------------------- |
142+
| `side` | `"left"` | `"right"` | `"left"` | Position of the editor sidebar. |
143+
| `className` | `string` | `undefined` | Extra CSS classes for the root element. |
144+
| `triggerClassName` | `string` | `undefined` | Extra CSS classes for the trigger button. |
145+
| `title` | `string` | `"Shadcn Theme Editor"` | Sidebar header text. |
146+
| `customColors` | `Record<string, string>` | `undefined` | Map of CSS vars → labels (e.g. `--primary: "Primary"`). |
147+
| `getContainer` | `() => HTMLElement` | `() => document.documentElement` | Element where dynamic styles will be injected. |
132148

133-
I would like to extend my heartfelt thanks to the following individuals and projects:
149+
## 🙌 Special Thanks
134150

135-
- **[Julian](https://github.com/jln13x)** - for creating [ui.jln.dev](https://ui.jln.dev/), 10000+ Themes for shadcn/ui.
151+
- [Julian](https://github.com/jln13x) creator of [ui.jln.dev](https://ui.jln.dev/), featuring 10,000+ Shadcn themes.
136152

137153
## 📄 License
138154

139-
This project is licensed under the `ℹ️ MIT` License.
155+
Licensed under the MIT License.

shadcn-theme-editor/src/(main)/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ export default function Editor({
4949
triggerClassName,
5050
toCssString,
5151
getCopyValue,
52-
title,
52+
title = "Shadcn Theme Editor",
5353
getContainer,
5454
}: {
5555
side?: Side;
@@ -196,7 +196,7 @@ export default function Editor({
196196
);
197197
}
198198

199-
function Header({ title = "Shadcn Theme Editor" }: { title?: string }) {
199+
function Header({ title }: { title: string }) {
200200
return (
201201
<div className="border-b px-2 shadow-md">
202202
<span className="flex items-center px-2 py-1 font-semibold">{title}</span>

shadcn-theme-editor/usage.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,3 @@
2323
- **Color Name/Title**: Displays the name of the color.
2424
- **Double-Click**: Copy the current color value to the clipboard.
2525
- **Hover**: Display the current value of the color in a tooltip.
26-
27-
### 6. Theme Changer
28-
29-
- Switch between theme modes: **System**, **Dark**, or **Light** using [`next-themes`](https://github.com/pacocoursey/next-themes).

usage.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
shadcn-theme-editor/usage.md

0 commit comments

Comments
 (0)