Input group
Joined input wrapper for addons, icons, and focus-within rings.
Composition
The preferred shape for composing the installed primitive from its exported parts.
Parts
Exported compound parts from the installed source.
InputGroup ├── InputGroupAddon └── InputGroupInput
First install and activate one skin. Core deliberately contains no visual token defaults.
The Control UI source installs this primitive from src/registry/sources/control-ui/ui/input-group.tsx. Install it on its own with the command above, or inspect the source below.
npx shadcn@latest add https://control-ui.dev/r/input-group.jsonKnobs
Typed custom properties the recipe paints with. Set one on the root — style, a utility class, or a skin — and every slot inherits it.
--cui-field-* · 8 knobsHow the cascade resolves--cui-field-radius<length-percentage>var(--radius-control)--cui-field-background*oklch(from var(--card) l c h / 0.72)--cui-field-foreground<color>var(--foreground)--cui-field-border-color<color>var(--border)--cui-field-border-width<length>1px--cui-field-shadow*var(--shadow-sm)--cui-field-backdrop-filter*blur(0px)--cui-field-focus-border-color<color>var(--border)Installed dependencies
Support files installed with this primitive — shared ones arrive once with your first Control UI component. Public dependencies stay linked to their own pages.
src/registry/sources/control-ui/control-variants.tsSupportRaw code
This primitive's source and the support files it installs with
"use client";import { useRender } from "@base-ui/react/use-render";import type { ComponentProps, CSSProperties } from "react";import type { RenderProp } from "@/components/control-ui/control-props";import type { ControlSize } from "@/components/control-ui/control-variants";import { controlSize } from "@/components/control-ui/control-variants";import type { FieldKnobStyle } from "@/components/control-ui/knob-contracts/field-knobs";import { cn } from "@/components/control-ui/lib/cn";export type InputGroupProps = Omit<ComponentProps<"div">, "style"> & { style?: CSSProperties & FieldKnobStyle } & { render?: RenderProp<ComponentProps<"div">>; size?: ControlSize;};export type InputGroupAddonProps = ComponentProps<"span"> & { style?: CSSProperties & FieldKnobStyle };export function InputGroup({ size = "md", className, render, children, ...props }: InputGroupProps) { const classes = cn("flex min-w-0 w-full items-center overflow-hidden", controlSize({ size }), className); return useRender({ defaultTagName: "div", render, props: { ...props, "data-control-ui": "input-group", "data-slot": "root", "data-control-family": "field", "data-control": "true", "data-size": size, className: classes, children, }, });}export function InputGroupAddon({ className, ...props }: InputGroupAddonProps) { return ( <span data-control-ui="input-group" data-control-family="field" data-field-kind="input-group" data-slot="addon" className={cn("inline-flex shrink-0 items-center", className)} {...props} /> );}export function InputGroupInput({ className, ...props }: ComponentProps<"input"> & { style?: CSSProperties & FieldKnobStyle }) { return ( <input data-control-ui="input-group" data-control-family="field" data-field-kind="input-group" data-slot="input" className={cn("h-full min-w-0 flex-1", className)} {...props} /> );}