BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/optics/input-group

Input Group

optics/input-group
FreeComponent

Groups input fields with addons, buttons, and text.

See it running

Open the demo on optics

optics.agusmayol.com.ar/components/input-group
Open
This registry sends X-Frame-Options, so its page cannot be embedded here. The link is the same page the frame would have shown.

Install it

npx shadcn@latest add https://optics.agusmayol.com.ar/r/input-group.json

Source

registry/optics/input-group.jsxoptics.agusmayol.com.ar/r/input-group.json
1"use client";
2
3import * as React from "react";
4import { cva } from "class-variance-authority";
5
6import { cn } from "@/lib/utils";
7import { Button, buttonVariants } from "@/registry/optics/button";
8import { Input } from "@/registry/optics/input";
9import { Textarea } from "@/registry/optics/textarea";
10
11function InputGroup({ className = "", variant, ...props }) {
12 return (
13 <div
14 data-slot="input-group"
15 role="group"
16 className={cn(
17 "border-input bg-input/20 dark:bg-input/30 has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-ring/30 has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[[data-slot][aria-invalid=true]]:border-destructive dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40 h-7 rounded-md border transition-colors has-data-[align=block-end]:rounded-md has-data-[align=block-start]:rounded-md has-[[data-slot=input-group-control]:focus-visible]:ring-[2px] has-[[data-slot][aria-invalid=true]]:ring-[2px] has-[textarea]:rounded-md has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>[data-align=block-end]]:[&>input]:pt-3 has-[>[data-align=block-start]]:[&>input]:pb-3 has-[>[data-align=inline-end]]:[&>input]:pr-1.5 has-[>[data-align=inline-start]]:[&>input]:pl-1.5 [[data-slot=combobox-content]_&]:focus-within:border-inherit [[data-slot=combobox-content]_&]:focus-within:ring-0 group/input-group relative flex w-full min-w-0 items-center outline-none has-[>textarea]:h-auto",
18 variant &&
19 buttonVariants({
20 variant: variant,
21 className: "cursor-text",
22 animation: "colors",
23 }),
24 className,
25 )}
26 {...props}
27 />
28 );
29}
30
31const inputGroupAddonVariants = cva(
32 "text-muted-foreground **:data-[slot=kbd]:bg-muted-foreground/10 h-auto gap-1 py-2 text-xs/relaxed font-medium group-data-[disabled=true]/input-group:opacity-50 **:data-[slot=kbd]:rounded-[calc(var(--radius-sm)-2px)] **:data-[slot=kbd]:px-1 **:data-[slot=kbd]:text-[0.625rem] [&>svg:not([class*='size-'])]:size-3.5 flex cursor-text items-center justify-center select-none",
33 {
34 variants: {
35 align: {
36 "inline-start":
37 "pl-2 has-[>button]:ml-[-0.275rem] has-[>kbd]:ml-[-0.275rem] order-first",
38 "inline-end":
39 "pr-2 has-[>button]:mr-[-0.275rem] has-[>kbd]:mr-[-0.275rem] order-last",
40 "block-start":
41// … truncated

What it pulls in

npm packages

  • class-variance-authority
  • clsx
  • tailwind-merge

Other registry items

  • https://optics.agusmayol.com.ar/r/button.json
  • https://optics.agusmayol.com.ar/r/input.json
  • https://optics.agusmayol.com.ar/r/textarea.json
  • https://optics.agusmayol.com.ar/r/utils.json

Files it writes

  • registry/optics/input-group.jsx

Facts

Registry
optics
Type
registry:component
Access
Free
Files written
1
Licence
MIT
First indexed
2026-08-01
Last confirmed
yesterday

Go to the source

Docs on optics optics.agusmayol.com.ar AgusMayol/optics on GitHub Raw registry item This item as JSON

More from optics

All 79 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
AccordionaccordionopticsComponentsFree5 deps
AlertalertopticsComponentsFree4 deps
Alert Dialogalert-dialogopticsComponentsFree4 deps
Aspect Ratioaspect-ratioopticsComponentsFree2 deps
Auto Heightauto-heightopticsComponentsFree3 deps
AvataravataropticsComponentsFree3 deps
BadgebadgeopticsComponentsFree4 deps
BreadcrumbbreadcrumbopticsComponentsFree4 deps
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