Files
shadcn-ui/apps/www/components/search.tsx
2023-01-24 19:51:29 +04:00

33 lines
994 B
TypeScript

"use client"
import * as React from "react"
import { cn } from "@/lib/utils"
import { Input } from "@/components/ui/input"
interface DocsSearchProps extends React.HTMLAttributes<HTMLFormElement> {}
export function DocsSearch({ className, ...props }: DocsSearchProps) {
function onSubmit(event: React.SyntheticEvent) {
event.preventDefault()
}
return (
<form
onSubmit={onSubmit}
className={cn("relative w-full", className)}
{...props}
>
<Input
type="search"
placeholder="Search documentation..."
className="h-9 sm:w-64 sm:pr-12"
disabled
/>
<kbd className="pointer-events-none absolute top-2 right-1.5 hidden h-5 select-none items-center gap-1 rounded border border-slate-100 bg-slate-100 px-1.5 font-mono text-[10px] font-medium text-slate-600 opacity-100 dark:border-slate-700 dark:bg-slate-900 dark:text-slate-400 sm:flex">
<span className="text-xs"></span>K
</kbd>
</form>
)
}