Input
retab-ui/inputFreeComponent
A styled text input built on Base UI.
Install it
npx shadcn@latest add https://ui.retab.com/r/input.jsonSource
1"use client";23import type * as React from "react";45import { cn } from "@/lib/utils";67export type InputProps = Omit<8 React.ComponentProps<"input"> & React.RefAttributes<HTMLInputElement>,9 "size"10> & {11 size?: "sm" | "default" | "lg" | number;12 unstyled?: boolean;13 nativeInput?: boolean;14};1516export function Input({17 className,18 size = "default",19 unstyled = false,20 nativeInput: _nativeInput = false,21 style,22 ...props23}: InputProps): React.ReactElement {24 const inputPaddingClass = unstyled ? "px-3" : "px-[calc(--spacing(3)-1px)]";25 const smallInputPaddingClass = unstyled26 ? "px-2.5"27 : "px-[calc(--spacing(2.5)-1px)]";28 const inputClassName = cn(29 "h-8.5 w-full min-w-0 rounded-[inherit] leading-8.5 outline-none [transition:background-color_5000000s_ease-in-out_0s] placeholder:text-muted-foreground/72 sm:h-7.5 sm:leading-7.5",30 inputPaddingClass,31 size === "sm" &&32 cn("h-7.5 leading-7.5 sm:h-6.5 sm:leading-6.5", smallInputPaddingClass),33 size === "lg" && "h-9.5 leading-9.5 sm:h-8.5 sm:leading-8.5",34 props.type === "search" &&35 "[&::-webkit-search-cancel-button]:appearance-none [&::-webkit-search-decoration]:appearance-none [&::-webkit-search-results-button]:appearance-none [&::-webkit-search-results-decoration]:appearance-none",36 props.type === "file" &&37 "text-muted-foreground file:me-3 file:bg-transparent file:text-sm file:font-medium file:text-foreground",38 );3940 return (41 <span42 className={43 cn(44 !unstyled &&45 "border-input bg-background text-foreground ring-ring/24 has-autofill:bg-foreground/4 has-focus-visible:border-ring has-aria-invalid:border-destructive/36 has-focus-visible:has-aria-invalid:border-destructive/64 has-focus-visible:has-aria-invalid:ring-destructive/16 dark:bg-input/32 dark:has-autofill:bg-foreground/8 dark:has-aria-invalid:ring-destructive/24 relative inline-flex w-full rounded-lg border text-base shadow-xs/5 transition-shadow not-dark:bg-clip-padding before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-lg)-1px)] not-has-disabled:not-has-focus-visible:not-has-aria-invalid:before:shadow-[0_1px_--theme(--color-black/4%)] has-focus-visible:ring-[3px] has-disabled:opacity-64 has-[:disabled,:focus-visible,[aria-invalid]]:shadow-none sm:text-sm dark:not-has-disabled:not-has-focus-visible:not-has-aria-invalid:before:shadow-[0_-1px_--theme(--color-white/6%)]",46 className,47 ) || undefined48 }49// … truncated
What it pulls in
npm packages
Other registry items
Files it writes
More from retab-ui
All 130 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Alertalert | retab-ui | Components | Free | 1 dep | |
| Alert Dialogalert-dialog | retab-ui | Components | Free | 1 dep | |
| Aspect Ratioaspect-ratio | retab-ui | Components | Free | no deps | |
| Attachment Sidebarattachment-sidebar | retab-ui | Components | Free | 1 dep | |
| Autocompleteautocomplete | retab-ui | Components | Free | 2 deps | |
| Calendarcalendar | retab-ui | Components | Free | 2 deps | |
| Code Viewercode-viewer | retab-ui | Components | Free | 2 deps · 32 files | |
| Commandcommand | retab-ui | Components | Free | 2 deps |
