yarn add @twilio-paste/input - or - yarn add @twilio-paste/core
import {Input} from '@twilio-paste/core/input';
import {Label} from '@twilio-paste/core/label';
import {HelpText} from '@twilio-paste/core/help-text';
const Component = () => (
<>
<Label htmlFor="foo" required>
foo
</Label>
<Input aria-describedby="foo_text" id="foo" name="foo" type="text" placeholder="foo" onChange={FOO} required />
<HelpText id="foo_text">Please enter some text</HelpText>
</>
);
cursor
- Type
any
disabled
Disables the input.
- Type
boolean
element
Overrides the default element name to apply unique styles with the Customization Provider.
- Type
any
- Default
'INPUT'
hasError
Sets the input to an error state.
- Type
boolean
height
- Type
never
i18nStepDownLabel
Provides an accessible label for the decrement button on inputs of type "number" when using non-English languages.
- Type
string
i18nStepUpLabel
Provides an accessible label for the increment button on inputs of type "number" when using non-English languages.
- Type
string
id
Sets the id of the input. Should match the htmlFor
of Label.
- Type
string
insertAfter
Used to add a suffix to an input. Often used with text or an icon.
- Type
| string | number | boolean | ReactElement<any, string | JSXElementConstructor<any>> | ReactFragment | ReactPortal
insertBefore
Used to add a prefix to an input. Often used with text or an icon.
- Type
| string | number | boolean | ReactElement<any, string | JSXElementConstructor<any>> | ReactFragment | ReactPortal
name
Sets the name of the input.
- Type
string
padding
- Type
"space0"
paddingRight
- Type
any
placeholder
Sets the placeholder of the input.
- Type
string
readOnly
Sets the input to readonly.
- Type
boolean
required
Sets the input as required.
- Type
boolean
size
- Type
never
style
- Type
never
type
Sets the type of the input.
- Type
any
value
Sets the value of the input.
- Type
string
variant
- Type
InputVariants
width
- Type
never
Inherited props
Paste components will often extend native HTML elements and as a result will inherit or extend their available properties. Below is a list of the props this component has inherited and are also available to use.