regex-input-incremental
domain-ui/regex-input-incrementalFreeComponent
domain-ui publishes no description for this item.
Install it
npx shadcn@latest add https://raw.githubusercontent.com/teurons/domain-ui/main/apps/web/public/r/regex-input-incremental.jsonSource
1"use client";23import type * as React from "react";4import { Input } from "@/components/ui/input";5import {6 useIncrementalRegex,7 type ValidationStatusType8} from "@/hooks/use-incremental-regex";910export interface RegexInputIncrementalProps11 extends React.ComponentProps<"input"> {12 regex: RegExp;13 onValidation?: (status: ValidationStatusType) => void;14 transformToUppercase?: boolean;15}1617export function RegexInputIncremental({18 regex,19 value,20 onChange,21 onValidation,22 defaultValue,23 transformToUppercase,24 ...props25}: RegexInputIncrementalProps) {26 const {27 value: displayValue,28 onChange: handleChange,29 onPaste: handlePaste,30 } = useIncrementalRegex({31 regex,32 value: value as string | undefined,33 onChange: onChange34 ? (newValue: string) => {35 const syntheticEvent = {36 target: { value: newValue },37 currentTarget: { value: newValue },38 } as React.ChangeEvent<HTMLInputElement>;39 onChange(syntheticEvent);40 }41 : undefined,42 onValidation,43 defaultValue: defaultValue as string | undefined,44 transformToUppercase,45 });4647 return (48 <Input49 {...props}50 value={displayValue}51 onChange={handleChange}52 onPaste={handlePaste}53 />54 );55}
What it pulls in
Other registry items
Files it writes
More from domain-ui
All 16 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| pan-inputpan-input | domain-ui | Components | Free | no deps | |
| pan-input-incrementalpan-input-incremental | domain-ui | Components | Free | no deps | |
| passport-inputpassport-input | domain-ui | Components | Free | no deps | |
| passport-input-incrementalpassport-input-incremental | domain-ui | Components | Free | no deps | |
| phone-inputphone-input | domain-ui | Components | Free | 2 deps | |
| portfolio-chartportfolio-chart | domain-ui | Components | Free | no deps | |
| regex-inputregex-input | domain-ui | Components | Free | no deps · 2 files | |
| responsive-resizable-previewresponsive-resizable-preview | domain-ui | Components | Free | no deps · 3 files |
