You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: package/README.md
+18-7Lines changed: 18 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
> [!WARNING]
2
-
> This package is still a work in progress, it is not yet recommended for production use.
2
+
> This package is still a work in progress, it is not yet recommended for production use. Contributions are welcome! My goal is to eventually build this out as a drop in replacement for `react-syntax-highlighter`
@@ -10,17 +10,30 @@ Syntax highlighting component for react using [Shiki](https://shiki.matsu.io/)
10
10
See the [demo](https://react-shiki.vercel.app/) page with multiple theme examples and usage instructions!
11
11
12
12
## Installation
13
+
13
14
```bash
14
-
npm install react-shiki
15
+
(pnpm|bun|yarn) add react-shiki
15
16
```
16
17
or
17
18
18
19
```bash
19
-
(pnpm|bun|yarn) add react-shiki
20
+
npm install react-shiki
20
21
```
21
22
22
23
## Usage
23
24
25
+
You can use the `ShikiHighlighter` component, or the `useShikiHighlighter` hook to highlight code.
26
+
27
+
28
+
`useShikiHighlighter` is a custom hook that takes in the code to be highlighted, the language, and the theme, and returns the highlighted code as a string:
0 commit comments