Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 21 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,14 @@ https://github.com/user-attachments/assets/58c8cca5-878a-4e64-aa06-a8e202318f2a
npm install @nobrainers/react-click-edit
```

### CSS Import

The component requires its base CSS file to be imported. Add the following import to your application:

```tsx
import "@nobrainers/react-click-edit/dist/style.css";
```

## 🚀 Quick Start

```tsx
Expand Down Expand Up @@ -145,12 +153,23 @@ function ControlledExample() {

## 🎨 Styling

The component comes with minimal default styling and can be fully customized using CSS classes. All main elements accept custom class names through props.
The component comes with minimal default styling through its base CSS file. You can override these styles or add additional styling using CSS classes. All main elements accept custom class names through props.

### Default Styling

Import the default styles in your application:

```tsx
import "@nobrainers/react-click-edit/dist/style.css";
```

### Custom Styling

Example with CSS modules:

```tsx
import styles from "./styles.module.css";
import "@nobrainers/react-click-edit/dist/style.css"; // Base styles
import styles from "./styles.module.css"; // Your custom styles

<InputClickEdit
className={styles.wrapper}
Expand Down
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
"name": "@nobrainers/react-click-edit",
"version": "1.2.0",
"description": "No Brainer input click to edit",
"main": "index.js",
"main": "dist/click-edit.umd.js",
"module": "dist/click-edit.es.js",
"types": "dist/index.d.ts",
"scripts": {
"build": "vite build",
"build:map": "vite build --sourcemap",
Expand Down
2 changes: 0 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
"lib": ["ESNext", "DOM"],
"jsx": "react-jsx",
"declaration": true,
"declarationMap": true,
"sourceMap": true,
"outDir": "dist",
"strict": true,
"moduleResolution": "node",
Expand Down
1 change: 1 addition & 0 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export default defineConfig({
}),
dts({
insertTypesEntry: true,
exclude: ["**/*.test.tsx"],
}),
],
css: {
Expand Down
Loading