input
lyse/inputFreeComponent
lyse publishes no description for this item.
Live preview
live · rendered by the registry
Rendered by lyse on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://ui.getlyse.com/r/input.jsonSource
1import * as React from "react"2import { cva, type VariantProps } from "class-variance-authority"34import { cn } from "@/lib/utils"5import "./input.css"67/* ------------------------------------------------------------------ */8/* CVA */9/* ------------------------------------------------------------------ */1011const inputVariants = cva(12 "input-base flex items-center overflow-hidden w-full",13 {14 variants: {15 variant: {16 default: "",17 destructive: "input-destructive",18 },19 size: {20 sm: "h-[var(--layout-size-lg)] gap-[var(--layout-gap-sm)] px-[var(--layout-padding-md)] rounded-[var(--layout-radius-lg)] text-content-note [&_svg]:h-[var(--layout-size-xs)] [&_svg]:w-[var(--layout-size-xs)]",21 md: "h-[var(--layout-size-xl)] gap-[var(--layout-gap-sm)] px-[var(--layout-padding-md)] rounded-[var(--layout-radius-lg)] text-content-note [&_svg]:h-[var(--layout-size-xs)] [&_svg]:w-[var(--layout-size-xs)]",22 lg: "h-[var(--layout-size-2xl)] gap-[var(--layout-gap-md)] px-[var(--layout-padding-lg)] rounded-[var(--layout-radius-xl)] text-content-body [&_svg]:h-[var(--layout-size-sm)] [&_svg]:w-[var(--layout-size-sm)]",23 },24 },25 defaultVariants: {26 variant: "default",27 size: "md",28 },29 }30)3132const inputHintVariants = cva("input-hint text-content-note", {33 variants: {34 variant: {35 default: "",36 destructive: "input-hint-destructive",37 },38 },39 defaultVariants: {40 variant: "default",41 },42})4344/* ------------------------------------------------------------------ */45/* Input */46/* ------------------------------------------------------------------ */4748function Input({49 className,50 variant,51 size,52 leading,53 trailing,54 disabled,55 ref,56 ...props57}: Omit<React.ComponentProps<"input">, "size"> &58 VariantProps<typeof inputVariants> & {59 leading?: React.ReactNode60 trailing?: React.ReactNode61 }) {62 return (63 <div64 data-slot="input"65 data-disabled={disabled || undefined}66 className={cn(inputVariants({ variant, size, className }))}67 >68 {leading && (69 <span70 data-slot="input-leading"71 className="input-leading shrink-0 flex items-center"72 >73 {leading}74 </span>75 )}76 <input77 ref={ref}78 disabled={disabled}79// … truncated
What it pulls in
npm packages
Other registry items
Files it writes
More from lyse
All 33 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| action-cardaction-card | lyse | Components | Free | no deps · 2 files | |
| alertalert | lyse | Components | Free | 2 deps · 2 files | |
| alert-dialogalert-dialog | lyse | Components | Free | 2 deps · 2 files | |
| avataravatar | lyse | Components | Free | 3 deps · 2 files | |
| badgebadge | lyse | Components | Free | 1 dep · 2 files | |
| banner-infobanner-info | lyse | Components | Free | 2 deps · 2 files | |
| breadcrumbbreadcrumb | lyse | Components | Free | 2 deps · 2 files | |
| buttonbutton | lyse | Components | Free | 2 deps · 2 files |
