ЁЯЪА Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more тЖТ
Socket
DemoInstallSign in
Socket

nepali-input-react

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nepali-input-react

Conversion functions, mappings, input and textarea components for nepali unicode romanized typing.

0.1.0
latest
Source
npm
Version published
Weekly downloads
22
4.76%
Maintainers
1
Weekly downloads
┬а
Created
Source

React-Nepali-Input / TextArea

Conversion functions, mappings, input and textarea components for nepali unicode romanized typing.

Installation

Install via npm or yarn

  npm install nepali-input-react

Usage/Examples

Basic input & textarea

import * as React from 'react';
import { NepaliInput, NepaliTextArea } from 'nepali-input-react';

export default function App() {
  const [text, setText] = React.useState('');

  return (
    <div>
      <NepaliInput value={text} onChange={e => setText(e.target.value)} />
      <NepaliTextArea value={text} onChange={e => setText(e.target.value)} />
    </div>
  );
}

Usage with material ui

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 (
    <Box sx={{ p: 8 }}>
      <TextField
        label="Type in nepali"
        value={text}
        onChange={e => setText(e.target.value)}
        name="nepali-textfield"
        id="nepali-textfield-input"
        InputProps={{
          inputComponent: NepaliInput,
        }}
        variant="outlined"
      />
    </Box>
  );
}

API Reference

english to nepali conversion function

import { getNepaliFromEnglish } from 'nepali-input-react';

getNepaliFromEnglish('mero nam HmoG ho.'); //рдореЗрд░реЛ рдирд╛рдо рдЕрдореЛрдШ рд╣реЛред

nepali to english conversion function

import { getEnglishFromNepali } from 'nepali-input-react';

getEnglishFromNepali('рдореЗрд░реЛ рдирд╛рдо рдЕрдореЛрдШ рд╣реЛред'); //mero nam HmoG ho.

mappings

import { mappings } from 'nepali-input-react';

mappings['a'];

input component

import { NepaliInput } from 'nepali-input-react';

export default function App() {
  return <NepaliInput />; // any props that <input /> accepts is a valid prop
}

textarea component

import { NepaliTextArea } from 'nepali-input-react';

export default function App() {
  return <NepaliTextArea />; // any props that <textarea /> accepts is a valid prop
}

License

MIT

Keywords

react

FAQs

Package last updated on 29 Aug 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts