pin-input
shipbase-ui/pin-inputFreeComponent
shipbase/ui publishes no description for this item.
Install it
npx shadcn@latest add https://raw.githubusercontent.com/shipbase/ui/next/apps/www/public/r/react/pin-input.jsonSource
1"use client"23import * as React from "react"45import { type HTMLArkProps, ark } from "@ark-ui/react/factory"6import {7 PinInput as PinInputPrimitive,8 pinInputAnatomy,9} from "@ark-ui/react/pin-input"10import { MinusIcon } from "lucide-react"1112import { cn } from "@/lib/utils"1314const parts = pinInputAnatomy.extendWith("group", "separator").build()1516const PinInput = React.forwardRef<17 React.ElementRef<typeof PinInputPrimitive.Root>,18 PinInputPrimitive.RootProps19>(({ children, ...props }, ref) => (20 <PinInputPrimitive.Root ref={ref} {...props}>21 {children}22 <PinInputPrimitive.HiddenInput />23 </PinInputPrimitive.Root>24))25PinInput.displayName = "PinInput"2627const PinInputContext = PinInputPrimitive.Context2829const PinInputControl = React.forwardRef<30 React.ElementRef<typeof PinInputPrimitive.Control>,31 PinInputPrimitive.ControlProps32>(({ className, ...props }, ref) => (33 <PinInputPrimitive.Control34 ref={ref}35 className={cn("flex items-center gap-2", className)}36 {...props}37 />38))39PinInputControl.displayName = "PinInputControl"4041const PinInputGroup = React.forwardRef<42 React.ElementRef<"div">,43 HTMLArkProps<"div">44>(({ className, ...props }, ref) => (45 <ark.div46 ref={ref}47 {...parts.group.attrs}48 className={cn("flex items-center", className)}49 {...props}50 />51))52PinInputGroup.displayName = "PinInputGroup"5354const PinInputInput = React.forwardRef<55 React.ElementRef<typeof PinInputPrimitive.Input>,56 PinInputPrimitive.InputProps57>(({ className, ...props }, ref) => (58 <PinInputPrimitive.Input59 ref={ref}60 className={cn(61 "relative h-9 w-9 border-input border-y border-r text-center text-sm shadow-xs outline-none transition-all placeholder:text-center placeholder:text-muted-foreground/70 first:rounded-l-md first:border-l last:rounded-r-md dark:bg-input/30",62 "focus-visible:z-10 focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50",63 "aria-invalid:border-destructive focus-visible:aria-invalid:ring-destructive/20 dark:focus-visible:aria-invalid:ring-destructive/40",64 className65 )}66 {...props}67 />68))69PinInputInput.displayName = "PinInputInput"7071const PinInputLabel = React.forwardRef<72 React.ElementRef<typeof PinInputPrimitive.Label>,73 PinInputPrimitive.LabelProps74>(({ className, ...props }, ref) => (75 <PinInputPrimitive.Label76 ref={ref}77 className={cn(78// … truncated
What it pulls in
npm packages
Files it writes
More from shipbase/ui
All 32 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| accordionaccordion | shipbase/ui | Components | Free | 2 deps | |
| avataravatar | shipbase/ui | Components | Free | 1 dep | |
| badgebadge | shipbase/ui | Components | Free | 2 deps | |
| buttonbutton | shipbase/ui | Components | Free | 2 deps | |
| cardcard | shipbase/ui | Components | Free | 1 dep | |
| checkboxcheckbox | shipbase/ui | Components | Free | 2 deps | |
| collapsiblecollapsible | shipbase/ui | Components | Free | 1 dep | |
| comboboxcombobox | shipbase/ui | Components | Free | 2 deps |
