react-markdown-typewriter 1.0.2 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +17 -1
- package/dist/components/MarkdownTypewriter.js +1 -1
- package/dist/components/MarkdownTypewriter.mjs +1 -1
- package/dist/components/MarkdownTypewriterAsync.d.mts +9 -0
- package/dist/components/MarkdownTypewriterAsync.d.ts +9 -0
- package/dist/components/MarkdownTypewriterAsync.js +1 -0
- package/dist/components/MarkdownTypewriterAsync.mjs +1 -0
- package/dist/components/index.d.mts +2 -1
- package/dist/components/index.d.ts +2 -1
- package/dist/components/index.js +1 -1
- package/dist/components/index.mjs +1 -1
- package/dist/functions/typewriterHook.d.mts +16 -0
- package/dist/functions/typewriterHook.d.ts +16 -0
- package/dist/functions/typewriterHook.js +1 -0
- package/dist/functions/typewriterHook.mjs +1 -0
- package/dist/index.d.mts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/dist/interfaces/MarkdownTypewriterProps.d.mts +7 -3
- package/dist/interfaces/MarkdownTypewriterProps.d.ts +7 -3
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# React Markdown Typewriter
|
|
2
2
|
|
|
3
|
-
This library provides
|
|
3
|
+
This library provides 2 new component, `MarkdownTypewriter` and `MarkdownTypewriterAsync`, that combines the Markdown component of [react-markdown](https://www.npmjs.com/package/react-markdown) with the animation of typewriter. The animation was created entirely with [motion](https://www.npmjs.com/package/motion).
|
|
4
4
|
|
|
5
5
|
Live demo: <https://codesandbox.io/p/sandbox/react-markdown-typewriter-rgjf6t>
|
|
6
6
|
|
|
@@ -79,6 +79,22 @@ export default function NarrationScreen() {
|
|
|
79
79
|
}
|
|
80
80
|
```
|
|
81
81
|
|
|
82
|
+
## Async
|
|
83
|
+
|
|
84
|
+
The `MarkdownTypewriterAsync` component is variant of the `MarkdownTypewriter` component for use with `React.Suspense`. It allows you to load the content of the Markdown file asynchronously. This is useful if you want to load the content of the Markdown file from a server or from a local file.
|
|
85
|
+
|
|
86
|
+
```tsx
|
|
87
|
+
import { MarkdownTypewriterAsync } from "react-markdown-typewriter";
|
|
88
|
+
|
|
89
|
+
export default function NarrationScreen() {
|
|
90
|
+
return (
|
|
91
|
+
<Suspense fallback={<div>...</div>}>
|
|
92
|
+
<MarkdownTypewriterAsync>Hello World</MarkdownTypewriterAsync>
|
|
93
|
+
</Suspense>
|
|
94
|
+
);
|
|
95
|
+
}
|
|
96
|
+
```
|
|
97
|
+
|
|
82
98
|
## API
|
|
83
99
|
|
|
84
100
|
### props
|