Autocomplete
blode-ui/autocompleteFreeComponent
An input that suggests matching values while typing.
Install it
npx shadcn@latest add https://raw.githubusercontent.com/mblode/blode-ui/main/public/r/autocomplete.jsonSource
1"use client";23import { Autocomplete as AutocompletePrimitive } from "@base-ui/react/autocomplete";4import type * as React from "react";56import { cn } from "@/lib/utils";78const Autocomplete = AutocompletePrimitive.Root;910const AutocompleteInput = ({11 className,12 ...props13}: React.ComponentProps<typeof AutocompletePrimitive.Input>) => (14 <AutocompletePrimitive.Input15 className={cn(16 "input flex h-[var(--field-height)] w-full rounded-[var(--field-radius)] border border-input bg-card px-[var(--field-padding-x)] py-[var(--field-padding-y)] font-normal font-sans text-base text-foreground leading-snug shadow-input transition-colors placeholder:text-placeholder-foreground hover:border-input-hover focus-visible:border-ring focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring/15 focus-visible:ring-offset-1 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50",17 className,18 )}19 data-slot="autocomplete-input"20 {...props}21 />22);2324const AutocompletePortal = ({25 ...props26}: React.ComponentProps<typeof AutocompletePrimitive.Portal>) => (27 <AutocompletePrimitive.Portal {...props} />28);2930const AutocompletePositioner = ({31 className,32 ...props33}: React.ComponentProps<typeof AutocompletePrimitive.Positioner>) => (34 <AutocompletePrimitive.Positioner35 className={cn("isolate z-110", className)}36 data-slot="autocomplete-positioner"37 {...props}38 />39);4041const AutocompletePopup = ({42 className,43 ...props44}: React.ComponentProps<typeof AutocompletePrimitive.Popup>) => (45 <AutocompletePrimitive.Popup46 className={cn(47 "fade-in-80 relative z-110 max-h-[250px] w-(--anchor-width) max-w-(--available-width) origin-(--transform-origin) animate-in overflow-hidden rounded-xl border border-border bg-popover p-0 text-popover-foreground shadow-soft",48 className,49 )}50 data-slot="autocomplete-popup"51 {...props}52 />53);5455const AutocompleteEmpty = ({56 className,57 ...props58}: React.ComponentProps<typeof AutocompletePrimitive.Empty>) => (59 <AutocompletePrimitive.Empty60 className={cn(61 "cursor-default px-4 py-3 text-center text-muted-foreground text-sm empty:hidden",62 className,63 )}64 data-slot="autocomplete-empty"65 {...props}66 />67);6869const AutocompleteList = ({70 className,71 ...props72}: React.ComponentProps<typeof AutocompletePrimitive.List>) => (73 <AutocompletePrimitive.List74 className={cn("w-full overflow-y-auto p-1", className)}75// … truncated
What it pulls in
npm packages
Files it writes
More from blode/ui
All 85 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Accordionaccordion | blode/ui | Components | Free | 2 deps | |
| Alertalert | blode/ui | Components | Free | no deps | |
| Alert Dialogalert-dialog | blode/ui | Components | Free | 1 dep | |
| Ask User Questionsask-user-questions | blode/ui | Components | Free | 1 dep | |
| Aspect Ratioaspect-ratio | blode/ui | Components | Free | 1 dep | |
| Attachmentattachment | blode/ui | Components | Free | 1 dep | |
| Avataravatar | blode/ui | Components | Free | 1 dep | |
| Badgebadge | blode/ui | Components | Free | 1 dep |
