
Security News
Meet Socket at Black Hat and DEF CON 2025 in Las Vegas
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
@acusti/css-value-input
Advanced tools
React component that renders a text input that can take and update a CSS value of a particular type with a default unit
CSSValueInput
is a React component that renders a text input that can
take and update a CSS value of a particular type with a default unit. The
input’s behavior is similar to those of design applications such as Adobe
Illustrator.
See the storybook docs and demo to get a feel for what it can do.
npm install @acusti/css-value-input
# or
yarn add @acusti/css-value-input
This is the type signature for the props you can pass to CSSValueInput
.
The unique features provided by the component are called out and explained
above the corresponding prop via JSDoc comments:
type Props = {
/**
* Boolean indicating if the user can submit an empty value (i.e. clear
* the value). Defaults to true.
*/
allowEmpty?: boolean;
className?: string;
cssValueType?: CSSValueType;
disabled?: boolean;
/**
* Function that receives a value and converts it to its numerical equivalent
* (i.e. '12px' → 12). Defaults to parseFloat().
*/
getValueAsNumber?: (value: string | number) => number;
icon?: React.ReactNode;
label?: string;
max?: number;
min?: number;
name?: string;
onBlur?: (event: React.FocusEvent<HTMLInputElement>) => unknown;
onChange?: (event: React.ChangeEvent<HTMLInputElement>) => unknown;
onFocus?: (event: React.FocusEvent<HTMLInputElement>) => unknown;
onKeyDown?: (event: React.KeyboardEvent<HTMLInputElement>) => unknown;
onKeyUp?: (event: React.KeyboardEvent<HTMLInputElement>) => unknown;
/**
* Custom event handler triggered when the user presses enter/return
* or blurs the input after making a change. Hitting esc will restore
* the previous submitted value or original value.
*/
onSubmitValue: (value: string) => unknown;
placeholder?: string;
step?: number;
tabIndex?: number;
title?: string;
unit?: string;
/** Regex or validator function to validate non-numeric values */
validator?: RegExp | ((value: string) => boolean);
value?: string;
};
FAQs
React component that renders a text input that can take and update a CSS value of a particular type with a default unit
The npm package @acusti/css-value-input receives a total of 168 weekly downloads. As such, @acusti/css-value-input popularity was classified as not popular.
We found that @acusti/css-value-input demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer 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
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
Security News
CAI is a new open source AI framework that automates penetration testing tasks like scanning and exploitation up to 3,600× faster than humans.
Security News
Deno 2.4 brings back bundling, improves dependency updates and telemetry, and makes the runtime more practical for real-world JavaScript projects.