-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1402fbe
commit d1a95c4
Showing
2 changed files
with
41 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ react-keywords | |
=== | ||
<!--rehype:ignore:end--> | ||
|
||
[![Build & Deploy](https://github.com/uiwjs/react-keywords/actions/workflows/ci.yml/badge.svg)](https://github.com/uiwjs/react-keywords/actions/workflows/ci.yml) | ||
[![CI](https://github.com/uiwjs/react-keywords/actions/workflows/ci.yml/badge.svg)](https://github.com/uiwjs/react-keywords/actions/workflows/ci.yml) | ||
[![npm version](https://img.shields.io/npm/v/react-keywords.svg)](https://www.npmjs.com/package/react-keywords) | ||
[![Open in unpkg](https://img.shields.io/badge/Open%20in-unpkg-blue)](https://uiwjs.github.io/npm-unpkg/#/pkg/react-keywords/file/README.md) | ||
|
||
|
@@ -34,6 +34,40 @@ export default function Demo() { | |
} | ||
``` | ||
|
||
```html | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<script src="https://unpkg.com/@babel/[email protected]/babel.min.js" crossorigin></script> | ||
<script src="https://unpkg.com/[email protected]/umd/react.development.js" crossorigin></script> | ||
<script src="https://unpkg.com/[email protected]/umd/react-dom.development.js" crossorigin></script> | ||
<script src="https://unpkg.com/@uiw/codepen-require-polyfill/index.js" crossorigin></script> | ||
</head> | ||
<body> | ||
<div id="container" style="padding: 24px"></div> | ||
<script src="https://unpkg.com/react-keywords/dist/keywords.min.js"></script> | ||
<script type="text/babel"> | ||
import Keywords from 'react-keywords'; | ||
function Demo() { | ||
const [value, setValue] = React.useState('react'); | ||
return ( | ||
<React.Fragment> | ||
<input value={value} onChange={(evn) => setValue(evn.target.value)} /> | ||
<Keywords value={value}> | ||
Highlight a keyword in a piece of text and return a React element. | ||
</Keywords> | ||
</React.Fragment> | ||
); | ||
} | ||
const container = document.getElementById('container'); | ||
const root = ReactDOM.createRoot(container); | ||
root.render(<Demo />); | ||
</script> | ||
</body> | ||
</html> | ||
``` | ||
|
||
## render | ||
|
||
```jsx mdx:preview | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters