mirror of
https://github.com/shadcn-ui/ui.git
synced 2026-02-08 18:39:31 +08:00
33 lines
994 B
TypeScript
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>
|
|
)
|
|
}
|