Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
@solid-aria/textfield
Advanced tools
TextFields are text inputs that allow users to input custom text entries with a keyboard.
createTextField
- Provides the behavior and accessibility implementation for a text field.npm install @solid-aria/textfield
# or
yarn add @solid-aria/textfield
# or
pnpm add @solid-aria/textfield
createTextField
Text fields can be built with <input>
or <textarea>
and <label>
elements, but you must manually ensure that they are semantically connected via ids for accessibility. createTextField
helps automate this, and handle other accessibility features while allowing for custom styling.
<input>
or <textarea>
elementimport { AriaTextFieldProps, createTextField } from "@solid-aria/textfield";
function TextField(props: AriaTextFieldProps<"input">) {
let ref: HTMLInputElement | undefined;
const { labelProps, inputProps, descriptionProps, errorMessageProps } = createTextField(
props,
() => ref
);
return (
<div style={{ display: "flex", "flex-direction": "column", width: "200px" }}>
<label {...labelProps}>{props.label}</label>
<input {...inputProps} ref={ref} />
<Show when={props.description}>
<div {...descriptionProps} style={{ "font-size": "12px" }}>
{props.description}
</div>
</Show>
<Show when={props.errorMessage}>
<div {...errorMessageProps} style={{ color: "red", "font-size": "12px" }}>
{props.errorMessage}
</div>
</Show>
</div>
);
}
function App() {
return (
<>
<TextField label="Email" />
<TextField
label="Email"
description="Enter an email for us to contact you about your order."
/>
<TextField label="Email" errorMessage="Please enter a valid email address." />
</>
);
}
In right-to-left languages, text fields should be mirrored. Ensure that your CSS accounts for this.
All notable changes are described in the CHANGELOG.md file.
FAQs
Primitives for building accessible text field component.
We found that @solid-aria/textfield demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 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.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.