input-group-button-group

PreviousNext
Docs
takiexample

Preview

Loading preview…
registry/new-york/examples/input-group-button-group.tsx
import { Link2Icon } from "lucide-react"

import {
  ButtonGroup,
  ButtonGroupText,
} from "@/registry/new-york/ui/button-group"
import {
  InputGroup,
  InputGroupAddon,
  InputGroupInput,
} from "@/registry/new-york/ui/input-group"
import { Label } from "@/registry/new-york/ui/label"

export default function InputGroupButtonGroup() {
  return (
    <div className="grid w-full max-w-sm gap-6">
      <ButtonGroup>
        <ButtonGroupText asChild>
          <Label htmlFor="url">https://</Label>
        </ButtonGroupText>
        <InputGroup>
          <InputGroupInput id="url" />
          <InputGroupAddon align="inline-end">
            <Link2Icon />
          </InputGroupAddon>
        </InputGroup>
        <ButtonGroupText>.com</ButtonGroupText>
      </ButtonGroup>
    </div>
  )
}

Installation

npx shadcn@latest add @taki/input-group-button-group

Usage

import { InputGroupButtonGroup } from "@/components/input-group-button-group"
<InputGroupButtonGroup />