New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@leafygreen-ui/text-input

Package Overview
Dependencies
Maintainers
3
Versions
108
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@leafygreen-ui/text-input

leafyGreen UI Kit Text Input

  • 2.0.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
3
Weekly downloads
 
Created
Source

Text Input

npm (scoped)

View on Storybook

Installation

Yarn

yarn add @leafygreen-ui/text-input

NPM

npm install @leafygreen-ui/text-input

Peer Dependencies

PackageVersion
@leafygreen-ui/leafygreen-provider^1.1.0

Example

import TextInput from '@leafygreen-ui/text-input';

const [value, setValue] = useState('');

return (
  <TextInput
    label='Email'
    description='Enter your email below'
    placeholder='your.email@example.com'
    onChange={event => { /* Something to handle the change event */ }}
    value={value}
  />
)

Output HTML

<div class="leafygreen-ui-4t2zpc">
  <label for="text-input-2604213" class="leafygreen-ui-1ie388">
    Email
  </label>
  <p class="leafygreen-ui-1vlu192">
    Enter your email below
  </p>
  <div class="leafygreen-ui-lzja97">
    <input data-leafygreen-ui="input-selector" class="leafygreen-ui-86cw8t" type="text" required="" placeholder="your.email@example.com" id="text-input-2604213" value="">
    <div data-leafygreen-ui="icon-selector" class="leafygreen-ui-m329s1"></div>
    <div class="leafygreen-ui-1andb55"></div>
  </div>
</div>

Properties

PropTypeDescriptionDefault
idstringid associated with the TextInput component.
labelstringText shown in bold above the input element.
descriptionstringText that gives more detail about the requirements for the input.
optionalbooleanMarks the input as optionalfalse
disabledbooleanDisabled the inputfalse
onChangefunctionThe event handler function for the 'onchange' event. Accepts the change event object as its argument and returns nothing.
placeholderstringThe placeholder text shown in the input field before the user begins typing.
errorMessagestringText that gives more detail about the requirements for the input.
statenone, valid, errorDescribes the state of the TextInput element before and after the input has been validatednone
valuestringSets the HTML value attribute.''
classNamestringAdds a className to the class attribute.''
typeemail, password, search, text, url, telSets type for TextInputtext

};

Any other properties will be spread on the input element.

FAQs

Package last updated on 01 Jul 2020

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

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc