npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

entoany

v1.0.14

Published

This is a custom language translated textfield allow you to set the preferred language in which you want to take input from user.

Downloads

5

Readme

EntoanyTextField - React Component

EntoanyTextField is a customizable React input component designed to handle text input with inline dropdowns, supporting multiple languages. It provides an easy-to-use interface for managing form fields and sending data to an API. This component is ideal for applications that require dynamic text fields with dropdowns and language support.


Table of Contents


Installation

To install EntoanyTextField, use npm or yarn:

npm install entoany --save
# or
yarn add entoany

Make sure you have React 16.8+ installed as this component uses React hooks.

Usage

Basic Example Here is a simple example of how to use the EntoanyTextField component:

import React, { useState } from 'react';
import { EntoanyTextField } from 'entoany';

function App() {
  const [name, setName] = useState("");

  const handleSelectedTextChange = (text) => {
    setName(text);
  };

  return (
    <div className="text-field-container">
      <EntoanyTextField
        preferredLanguage="en"
        hintText="Enter your name"
        onSelectedTextChange={handleSelectedTextChange}
        width="40%"
        height="20px"
        dropdownWidth="40%"
      />
      <div>Your Name: {name}</div>
    </div>
  );
}

export default App;

In the above example:

  • The component takes a hint text and allows users to input data.
  • The onSelectedTextChange handler updates the name state when the input changes.
  • The width,height and dropdownWidth props control the layout of the text field and dropdown.

Handling Multiple Fields

You can use multiple instances of EntoanyTextField to handle different types of inputs in your form. Here's an example with multiple fields:

import React, { useState } from 'react';
import { EntoanyTextField } from 'entoany';

function App() {
  const [name, setName] = useState("");
  const [age, setAge] = useState("");
  const [email, setEmail] = useState("");

  const handleSelectedTextChange = (field, text) => {
    if (field === "name") {
      setName(text);
    } else if (field === "age") {
      setAge(text);
    } else if (field === "email") {
      setEmail(text);
    }
  };

  return (
    <div className="text-field-container">
      <EntoanyTextField
        preferredLanguage="en"
        hintText="Enter your name"
        onSelectedTextChange={(text) => handleSelectedTextChange("name", text)}
        width="40%"
        height="20px"
        dropdownWidth="40%"
      />
      <EntoanyTextField
        preferredLanguage="en"
        hintText="Enter your age"
        onSelectedTextChange={(text) => handleSelectedTextChange("age", text)}
        height="20px"
        width="40%"
      />
      <EntoanyTextField
        preferredLanguage="en"
        hintText="Enter your email"
        onSelectedTextChange={(text) => handleSelectedTextChange("email", text)}
        width="40%"
        height="20px"
        dropdownWidth="40%"
      />
    </div>
  );
}

export default App;

Sending Data to API

After collecting data from multiple fields, you can send it to your backend API. Here’s an example that demonstrates how to do this:

import React, { useState } from 'react';
import { EntoanyTextField } from 'entoany';

function App() {
  const [name, setName] = useState("");
  const [age, setAge] = useState("");
  const [email, setEmail] = useState("");

  const handleSelectedTextChange = (field, text) => {
    if (field === "name") {
      setName(text);
    } else if (field === "age") {
      setAge(text);
    } else if (field === "email") {
      setEmail(text);
    }
  };

  const sendDataToApi = async () => {
    const data = {
      name: name,
      age: age,
      email: email,
    };

    try {
      const response = await fetch("https://your-api-endpoint.com/submit", {
        method: "POST",
        headers: {
          "Content-Type": "application/json",
        },
        body: JSON.stringify(data),
      });

      if (response.ok) {
        console.log("Data submitted successfully!");
      } else {
        console.error("Error submitting data.");
      }
    } catch (error) {
      console.error("Error:", error);
    }
  };

  return (
    <div className="text-field-container">
      <EntoanyTextField
        preferredLanguage="en"
        hintText="Enter your name"
        onSelectedTextChange={(text) => handleSelectedTextChange("name", text)}
        width="40%"
        height="20px"
        dropdownWidth="40%"
      />
      <EntoanyTextField
        preferredLanguage="en"
        hintText="Enter your age"
        onSelectedTextChange={(text) => handleSelectedTextChange("age", text)}
        height="20px"
        width="40%"
      />
      <EntoanyTextField
        preferredLanguage="en"
        hintText="Enter your email"
        onSelectedTextChange={(text) => handleSelectedTextChange("email", text)}
        width="40%"
        height="20px"
        dropdownWidth="40%"
      />
      <button onClick={sendDataToApi}>Submit</button>
    </div>
  );
}

export default App;

This will send the data collected from the input fields to your backend API.

Props

The following table lists the props that can be passed to the EntoanyTextField component.

| Prop | Type | Description | Default | | ---------------------- | ---------- | ------------------------------------------------------------------------------------------------------------------------------------- | --------------- | | preferredLanguage | string | The language in which the text field should be displayed. Typically set to "en" for English or "ne" for Nepali. | "en" | | hintText | string | Placeholder text displayed inside the input field. | "Enter value" | | onSelectedTextChange | function | Callback function that is triggered when the text selection changes in the input field. It receives the selected text as an argument. | null | | width | string | Defines the width of the input field, e.g., "40%" or "100%". | "100%" | | dropdownWidth | string | Defines the width of the dropdown next to the input field, e.g., "40%" or "100%". | "100%" | | height | string | Defines the height of the input field, e.g., "40px" or "50px". | "40px" |

License

This project is licensed under the MIT License - see the LICENSE file for details.