Security News
New Python Packaging Proposal Aims to Solve Phantom Dependency Problem with SBOMs
PEP 770 proposes adding SBOM support to Python packages to improve transparency and catch hidden non-Python dependencies that security tools often miss.
@rmwc/textfield
Advanced tools
Text fields allow users to input, edit, and select text.
<TextField label="standard..." />
<TextField outlined label="outlined..." />
<TextField placeholder="No label" />
<>
{/* Leading and trailing icons can be used.*/}
<TextField icon="search" trailingIcon="close" label="icon..." />
{/* If you need full control over the icon, you can pass the icon as options with your own props. Dont forget the TabIndex to make it clickable*/}
<TextField
label="trailingIcon..."
trailingIcon={{
icon: 'close',
tabIndex: 0,
onClick: () => console.log('Clear')
}}
/>
</>
<TextField fullwidth label="fullwidth..." />
You can make the TextField a textarea. Make sure to include outlined
for proper styling You can optionally make help text always visible by passing an object as props with persistent set to true. Textareas can also have an optional character counter which will work with the maxLength property.
<div>
<TextField
textarea
label="textarea..."
rows={8}
maxLength={20}
characterCount
resizeable
helpText={{
persistent: true,
validationMsg: true,
children: 'The field is required'
}}
/>
</div>
<TextField disabled label="Disabled..." />
<TextField required label="Required..." value="" />
<TextField
invalid
label="Invalid..."
value="#@!$"
onChange={() => {}}
/>
<TextField label="Validate Pattern" pattern="[A-Za-z]{3}" />
A preview of how material-components-web
handles styling input types for your browser.
<>
<TextField label="text" type="text" />
<TextField label="color" type="color" style={{ width: '6rem' }} />
<TextField label="date" type="date" />
<TextField label="datetime-local" type="datetime-local" />
<TextField label="month" type="month" />
<TextField label="range" type="range" />
<TextField label="time" type="time" />
<TextField label="week" type="week" />
</>
A TextField component for accepting text input from a user.
Name | Type | Description |
---|---|---|
align | "start" | "end" | How to align the text inside the TextField. Defaults to 'start'. |
characterCount | boolean | Shows the character count, must be used in conjunction with maxLength. |
disabled | boolean | Makes the Textfield disabled. |
floatLabel | boolean | The label floats automatically based on value, but you can use this prop for manual control. |
foundationRef | Ref<null | MDCTextFieldFoundation<>> | Advanced: A reference to the MDCFoundation. |
fullwidth | boolean | Makes the TextField fullwidth. |
helpText | ReactNode | TextFieldHelperTextProps | Adds help text to the field |
icon | IconPropT | Add a leading icon. |
inputRef | Ref<null | HTMLInputElement<> | HTMLTextAreaElement<>> | A reference to the native input or textarea. |
invalid | boolean | Makes the TextField visually invalid. This is sometimes automatically applied in cases where required or pattern is used. |
label | ReactNode | A label for the input. |
outlined | boolean | Outline the TextField. |
prefix | string | Add prefix. |
required | boolean | Makes the Textfield required. |
resizeable | boolean | Make textarea resizeable |
ripple | RipplePropT | Adds a ripple effect to the component |
rootProps | Object | By default, props spread to the input. These props are for the component's root container. |
suffix | string | Add suffix. |
textarea | boolean | Makes a multiline TextField. |
trailingIcon | IconPropT | Add a trailing icon. |
type | string | The type of input field to render, search, number, etc |
value | string | number | Sets the value for controlled TextFields. |
FAQs
RMWC TextField component
The npm package @rmwc/textfield receives a total of 2,643 weekly downloads. As such, @rmwc/textfield popularity was classified as popular.
We found that @rmwc/textfield demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
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.
Security News
PEP 770 proposes adding SBOM support to Python packages to improve transparency and catch hidden non-Python dependencies that security tools often miss.
Security News
Socket CEO Feross Aboukhadijeh discusses open source security challenges, including zero-day attacks and supply chain risks, on the Cyber Security Council podcast.
Security News
Research
Socket researchers uncover how threat actors weaponize Out-of-Band Application Security Testing (OAST) techniques across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.