Home / File/ input-group-button.tsx — ui Source File

input-group-button.tsx — ui Source File

Architecture documentation for input-group-button.tsx, a tsx file in the ui codebase. 5 imports, 0 dependents.

File tsx ComponentRegistry ChartRegistry 5 imports 1 functions

Entity Profile

Dependency Diagram

graph LR
  35469183_aa48_fdd4_aeac_53ff8b38b7c0["input-group-button.tsx"]
  1d141819_425e_b5fd_4c8e_32f7c6a42cf2["react"]
  35469183_aa48_fdd4_aeac_53ff8b38b7c0 --> 1d141819_425e_b5fd_4c8e_32f7c6a42cf2
  39a0d62e_8e7d_d097_eb95_91d2bca361f7["icons-react"]
  35469183_aa48_fdd4_aeac_53ff8b38b7c0 --> 39a0d62e_8e7d_d097_eb95_91d2bca361f7
  16fc7cf6_3e3a_9efc_f45b_63496f779853["use-copy-to-clipboard"]
  35469183_aa48_fdd4_aeac_53ff8b38b7c0 --> 16fc7cf6_3e3a_9efc_f45b_63496f779853
  41df1c2c_a3b4_dc22_8bc9_310fe8b6ba9b["input-group"]
  35469183_aa48_fdd4_aeac_53ff8b38b7c0 --> 41df1c2c_a3b4_dc22_8bc9_310fe8b6ba9b
  64a3481c_a85b_fe79_409a_cb7f3f4bb871["popover"]
  35469183_aa48_fdd4_aeac_53ff8b38b7c0 --> 64a3481c_a85b_fe79_409a_cb7f3f4bb871
  style 35469183_aa48_fdd4_aeac_53ff8b38b7c0 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

"use client"

import * as React from "react"
import {
  IconCheck,
  IconCopy,
  IconInfoCircle,
  IconStar,
} from "@tabler/icons-react"

import { useCopyToClipboard } from "@/hooks/use-copy-to-clipboard"
import {
  InputGroup,
  InputGroupAddon,
  InputGroupButton,
  InputGroupInput,
} from "@/registry/new-york-v4/ui/input-group"
import {
  Popover,
  PopoverContent,
  PopoverTrigger,
} from "@/registry/new-york-v4/ui/popover"

export default function InputGroupButtonExample() {
  const { copyToClipboard, isCopied } = useCopyToClipboard()
  const [isFavorite, setIsFavorite] = React.useState(false)

  return (
    <div className="grid w-full max-w-sm gap-6">
      <InputGroup>
        <InputGroupInput placeholder="https://x.com/shadcn" readOnly />
        <InputGroupAddon align="inline-end">
          <InputGroupButton
            aria-label="Copy"
            title="Copy"
            size="icon-xs"
            onClick={() => {
              copyToClipboard("https://x.com/shadcn")
            }}
          >
            {isCopied ? <IconCheck /> : <IconCopy />}
          </InputGroupButton>
        </InputGroupAddon>
      </InputGroup>
      <InputGroup className="[--radius:9999px]">
        <Popover>
          <PopoverTrigger asChild>
            <InputGroupAddon>
              <InputGroupButton variant="secondary" size="icon-xs">
                <IconInfoCircle />
              </InputGroupButton>
            </InputGroupAddon>
          </PopoverTrigger>
          <PopoverContent
            align="start"
            className="flex flex-col gap-1 rounded-xl text-sm"
          >
            <p className="font-medium">Your connection is not secure.</p>
            <p>You should not enter any sensitive information on this site.</p>
          </PopoverContent>
        </Popover>
        <InputGroupAddon className="text-muted-foreground pl-1.5">
          https://
        </InputGroupAddon>
        <InputGroupInput id="input-secure-19" />
        <InputGroupAddon align="inline-end">
          <InputGroupButton
            onClick={() => setIsFavorite(!isFavorite)}
            size="icon-xs"
          >
            <IconStar
              data-favorite={isFavorite}
              className="data-[favorite=true]:fill-blue-600 data-[favorite=true]:stroke-blue-600"
            />
          </InputGroupButton>
        </InputGroupAddon>
      </InputGroup>
      <InputGroup>
        <InputGroupInput placeholder="Type to search..." />
        <InputGroupAddon align="inline-end">
          <InputGroupButton variant="secondary">Search</InputGroupButton>
        </InputGroupAddon>
      </InputGroup>
    </div>
  )
}

Subdomains

Dependencies

  • icons-react
  • input-group
  • popover
  • react
  • use-copy-to-clipboard

Frequently Asked Questions

What does input-group-button.tsx do?
input-group-button.tsx is a source file in the ui codebase, written in tsx. It belongs to the ComponentRegistry domain, ChartRegistry subdomain.
What functions are defined in input-group-button.tsx?
input-group-button.tsx defines 1 function(s): InputGroupButtonExample.
What does input-group-button.tsx depend on?
input-group-button.tsx imports 5 module(s): icons-react, input-group, popover, react, use-copy-to-clipboard.
Where is input-group-button.tsx in the architecture?
input-group-button.tsx is located at apps/v4/registry/new-york-v4/examples/input-group-button.tsx (domain: ComponentRegistry, subdomain: ChartRegistry, directory: apps/v4/registry/new-york-v4/examples).

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free