https://github.com/xamogh/nepali-input-react
input and textarea to type in nepali romanized unicode
https://github.com/xamogh/nepali-input-react
input material-ui mui nepali textarea type unicode
Last synced: 9 months ago
JSON representation
input and textarea to type in nepali romanized unicode
- Host: GitHub
- URL: https://github.com/xamogh/nepali-input-react
- Owner: xamogh
- License: mit
- Created: 2022-08-29T09:21:05.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2022-08-29T09:39:55.000Z (almost 4 years ago)
- Last Synced: 2025-03-12T16:45:25.007Z (about 1 year ago)
- Topics: input, material-ui, mui, nepali, textarea, type, unicode
- Language: TypeScript
- Homepage: https://www.npmjs.com/package/nepali-input-react
- Size: 218 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# React-Nepali-Input / TextArea
Conversion functions, mappings, input and textarea components for nepali unicode romanized typing.
## Installation
Install via npm or yarn
```bash
npm install nepali-input-react
```
## Usage/Examples
#### Basic input & textarea
```javascript
import * as React from 'react';
import { NepaliInput, NepaliTextArea } from 'nepali-input-react';
export default function App() {
const [text, setText] = React.useState('');
return (
setText(e.target.value)} />
setText(e.target.value)} />
);
}
```
#### Usage with material ui
```javascript
import * as React from 'react';
import { NepaliInput } from 'nepali-input-react';
import { Box, TextField } from '@mui/material';
export default function App() {
const [text, setText] = React.useState('');
return (
setText(e.target.value)}
name="nepali-textfield"
id="nepali-textfield-input"
InputProps={{
inputComponent: NepaliInput,
}}
variant="outlined"
/>
);
}
```
## API Reference
#### english to nepali conversion function
```javascript
import { getNepaliFromEnglish } from 'nepali-input-react';
getNepaliFromEnglish('mero nam HmoG ho.'); //मेरो नाम अमोघ हो।
```
#### nepali to english conversion function
```javascript
import { getEnglishFromNepali } from 'nepali-input-react';
getEnglishFromNepali('मेरो नाम अमोघ हो।'); //mero nam HmoG ho.
```
#### mappings
```javascript
import { mappings } from 'nepali-input-react';
mappings['a'];
```
#### input component
```javascript
import { NepaliInput } from 'nepali-input-react';
export default function App() {
return ; // any props that accepts is a valid prop
}
```
#### textarea component
```javascript
import { NepaliTextArea } from 'nepali-input-react';
export default function App() {
return ; // any props that accepts is a valid prop
}
```
## License
[MIT](https://choosealicense.com/licenses/mit/)