BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/fluid-functionalism/input-group

Input Group

fluid-functionalism/input-group
FreeComponent

Grouped input fields with proximity-based highlighting, animated label transitions, optional icons, and error states.

Install it

npx shadcn@latest add https://fluidfunctionalism.com/r/input-group.json

Source

registry/default/input-group.tsxfluidfunctionalism.com/r/input-group.json · first 6 KB
1"use client";
2
3import {
4 useRef,
5 useState,
6 useEffect,
7 useMemo,
8 createContext,
9 useContext,
10 forwardRef,
11 type ReactNode,
12 type HTMLAttributes,
13 type InputHTMLAttributes,
14} from "react";
15import { Field } from "@base-ui/react/field";
16import type { IconComponent } from "@/lib/icon-context";
17import { cn } from "@/lib/utils";
18import { fontWeights } from "@/lib/font-weight";
19import { useShape } from "@/lib/shape-context";
20import { useProximityHover } from "@/hooks/use-proximity-hover";
21
22interface InputGroupContextValue {
23 registerItem: (index: number, element: HTMLElement | null) => void;
24 activeIndex: number | null;
25}
26
27const InputGroupContext = createContext<InputGroupContextValue | null>(null);
28
29function useInputGroup() {
30 const ctx = useContext(InputGroupContext);
31 if (!ctx)
32 throw new Error("useInputGroup must be used within an InputGroup");
33 return ctx;
34}
35
36interface InputGroupProps extends HTMLAttributes<HTMLDivElement> {
37 children: ReactNode;
38}
39
40const InputGroup = forwardRef<HTMLDivElement, InputGroupProps>(
41 ({ children, className, ...props }, ref) => {
42 const containerRef = useRef<HTMLDivElement>(null);
43
44 const { activeIndex, handlers, registerItem, measureItems } =
45 useProximityHover(containerRef);
46
47 useEffect(() => {
48 measureItems();
49 }, [measureItems, children]);
50
51 const contextValue = useMemo(
52 () => ({ registerItem, activeIndex }),
53 [registerItem, activeIndex]
54 );
55
56 return (
57 <InputGroupContext.Provider value={contextValue}>
58 <div
59 ref={(node) => {
60 (containerRef as React.MutableRefObject<HTMLDivElement | null>).current = node;
61 if (typeof ref === "function") ref(node);
62 else if (ref) (ref as React.MutableRefObject<HTMLDivElement | null>).current = node;
63 }}
64 onMouseEnter={handlers.onMouseEnter}
65 onMouseMove={handlers.onMouseMove}
66 onMouseLeave={handlers.onMouseLeave}
67 // `relative` makes this div the fields' offsetParent — the proximity
68 // hook measures items via offsetTop and compares against
69 // container-relative mouse coords, so the two coordinate spaces must
70 // share this origin (same as every other proximity consumer).
71 className={cn("relative flex flex-col gap-3 w-72 max-w-full", className)}
72 {...props}
73 >
74 {children}
75 </div>
76 </InputGroupContext.Provider>
77 );
78 }
79);
80
81// … truncated

What it pulls in

npm packages

  • lucide-react
  • @base-ui/react

Other registry items

  • utils
  • https://www.fluidfunctionalism.com/r/font-weight.json
  • https://www.fluidfunctionalism.com/r/shape-context.json
  • https://www.fluidfunctionalism.com/r/icon-context.json
  • https://www.fluidfunctionalism.com/r/use-proximity-hover.json

Files it writes

  • registry/default/input-group.tsx

Facts

Registry
fluid-functionalism
Type
registry:ui
Access
Free
Files written
1
Licence
MIT
First indexed
2026-08-02
Last confirmed
today

Go to the source

fluidfunctionalism.com mickadesign/fluid-functionalism on GitHub Raw registry item This item as JSON

More from fluid-functionalism

All 53 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
Accordionaccordionfluid-functionalismComponentsFree3 deps
Accordion (Base UI)accordion-basefluid-functionalismComponentsFree3 deps
Ask User Questionsask-user-questionsfluid-functionalismComponentsFree2 deps
Badgebadgefluid-functionalismComponentsFree1 dep
Buttonbuttonfluid-functionalismComponentsFree4 deps
Button (Base UI)button-basefluid-functionalismComponentsFree4 deps
Cardcardfluid-functionalismComponentsFree1 dep
Chat Messagechat-messagefluid-functionalismComponentsFree1 dep
BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex

BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex

BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex