Socket
Book a DemoInstallSign in
Socket

ojas-ui

Package Overview
Dependencies
Maintainers
0
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ojas-ui

1.0.0
latest
npmnpm
Version published
Weekly downloads
0
Maintainers
0
Weekly downloads
 
Created
Source

@ojas-ui/card

A reusable text input component for React applications, built with TypeScript.

Installation

Install the package using npm:

npm install @ojas-ui/card

or using Yarn:

yarn add @ojas-ui/card

Usage

Import the OjasTextInput component and use it in your React application:

import React from "react";
import { OjasTextInput } from "@ojas-ui/card";

const App = () => {
  const handleChange = (event: React.ChangeEvent<HTMLInputElement>) => {
    console.log(event.target.value);
  };

  return (
    <div>
      <OjasTextInput
        value="test"
        name="firstName"
        onChange={handleChange}
        placeholder="First Name"
      />
    </div>
  );
};

export default App;

Props

PropTypeDefaultDescription
valuestringThe value of the input field.
namestringThe name attribute of the input field.
onChange(event: React.ChangeEvent<HTMLInputElement>) => voidFunction to handle the change event.
placeholderstring""The placeholder text for the input field.
type"text" | "password" | "email" | "number""text"The type of the input field.
classNamestring""Additional class names for custom styling.
disabledbooleanfalseWhether the input field is disabled.
widthstring | number"100%"The width of the input field.
heightstring | number40The height of the input field.
borderRadiusnumber4The border radius of the input field.
fontSizenumber14The font size of the input field.
paddingnumber8The padding inside the input field.
autoCompletestring"off"The autocomplete attribute of the input field.
maxLengthnumberThe maximum length of the input field.
readOnlybooleanfalseWhether the input field is read-only.
requiredbooleanWhether the input field is required.
marginBottomnumberThe bottom margin of the input field.
labelstringThe label text for the input field.
borderstring"1px solid var(--form-border-color, #dbdfe9)"The border of the input field.
backgroundColorstring"transparent"The background color of the input field.
iconReact.ReactNodeAn optional icon to display inside the input field.
iconPosition"left" | "right""left"The position of the icon inside the input field.

Customization

The OjasTextInput component is designed to be easily customizable. You can pass additional class names through the className prop to style the component using your own CSS.

Example with Custom Styling

import React from "react";
import { OjasTextInput } from "@ojas-ui/card";
import "./customStyles.css";

const App = () => {
  const handleChange = (event: React.ChangeEvent<HTMLInputElement>) => {
    console.log(event.target.value);
  };

  return (
    <div>
      <OjasTextInput
        value="test"
        name="firstName"
        onChange={handleChange}
        placeholder="First Name"
        className="custom-input"
      />
    </div>
  );
};

export default App;

customStyles.css

.custom-input {
  border: 2px solid #4caf50;
  border-radius: 8px;
  padding: 10px;
}

Development

Building the Package

To build the package, run:

npm run build

Running Tests

To run the tests, use:

npm test

Contributing

Contributions are welcome! Please open an issue or submit a pull request on GitHub.

License

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

Author

Nagendra Goud Porumalla

Acknowledgements

Special thanks to all the contributors and the open-source community for their valuable contributions.

FAQs

Package last updated on 16 Feb 2025

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

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.