input
adrianub/inputFreeComponent
adrianub publishes no description for this item.
Live preview
live · rendered by the registry
Rendered by adrianub on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://ui.adrianub.dev/r/styles/new-york/input.jsonSource
1import { computed, Directive, input } from '@angular/core'23import { cn } from '~/lib/utils'45export type InputType6 = | 'date'7 | 'datetime-local'8 | 'email'9 | 'month'10 | 'number'11 | 'password'12 | 'tel'13 | 'file'14 | 'search'15 | 'text'1617@Directive({18 selector: '[ubInput]',19 standalone: true,20 host: {21 '[class]': 'computedClass()',22 '[type]': 'type()',23 },24})25export class UbInputDirective<Type extends InputType> {26 readonly type = input.required<Type>()27 readonly class = input<string>()2829 protected computedClass = computed(() =>30 cn(31 'flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50',32 this.class(),33 ),34 )35}
Files it writes
More from adrianub
All 23 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| accordionaccordion | adrianub | Components | Free | 1 dep | |
| alertalert | adrianub | Components | Free | no deps | |
| aspect-ratioaspect-ratio | adrianub | Components | Free | 1 dep | |
| avataravatar | adrianub | Components | Free | 1 dep | |
| badgebadge | adrianub | Components | Free | no deps | |
| breadcrumbbreadcrumb | adrianub | Components | Free | no deps | |
| buttonbutton | adrianub | Components | Free | no deps | |
| cardcard | adrianub | Components | Free | no deps |
