"use client" import { useState } from "react" import { toast } from "sonner" import { Example, ExampleWrapper, } from "@/registry/bases/base/components/example" import { Button } from "@/registry/bases/base/ui/button" import { ButtonGroup, ButtonGroupText, } from "@/registry/bases/base/ui/button-group" import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, } from "@/registry/bases/base/ui/card" import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger, } from "@/registry/bases/base/ui/dropdown-menu" import { Field, FieldDescription, FieldGroup, FieldLabel, } from "@/registry/bases/base/ui/field" import { Input } from "@/registry/bases/base/ui/input" import { InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, InputGroupText, InputGroupTextarea, } from "@/registry/bases/base/ui/input-group" import { Kbd, KbdGroup } from "@/registry/bases/base/ui/kbd" import { Popover, PopoverContent, PopoverDescription, PopoverHeader, PopoverTitle, PopoverTrigger, } from "@/registry/bases/base/ui/popover" import { Spinner } from "@/registry/bases/base/ui/spinner" import { Textarea } from "@/registry/bases/base/ui/textarea" import { Tooltip, TooltipContent, TooltipTrigger, } from "@/registry/bases/base/ui/tooltip" import { IconPlaceholder } from "@/app/(create)/components/icon-placeholder" export default function InputGroupExample() { const [country, setCountry] = useState("+1") return ( ) } function InputGroupBasic() { return ( Default (No Input Group) Input Group Disabled Invalid ) } function InputGroupWithAddons() { return ( Addon (inline-start) Addon (inline-end) Addon (inline-start and inline-end) Addon (block-start) First Name Addon (block-end) 20/240 characters Multiple Icons toast("Copied to clipboard")} > Description This is a description of the input group. Label Label (optional) ) } function InputGroupWithButtons() { return ( Button Default Outline Secondary Button ) } function InputGroupWithTooltip({ country, setCountry, }: { country: string setCountry: (value: string) => void }) { return ( Tooltip } > This is content in a tooltip. This is a description of the input group. Dropdown } > {country}{" "} setCountry("+1")}> +1 setCountry("+44")}> +44 setCountry("+46")}> +46 This is a description of the input group. Popover } nativeButton={false}> Your connection is not secure. You should not enter any sensitive information on this site. https:// toast("Added to favorites")} > This is a description of the input group. Button Group https:// .com This is a description of the input group. ) } function InputGroupWithKbd() { return ( Input Group with Kbd ⌘K ⌘K Ask AI Tab Ctrl C Username
This username is available.
12 results Disabled First Name Last Name Loading ("data-disabled="true") This is a description of the input group.
) } function InputGroupInCard() { return ( Card with Input Group This is a card with an input group. Email Address Website URL https:// Feedback & Comments 0/500 characters ) } function InputGroupTextareaExamples() { return ( Default Textarea (No Input Group)