响应式搜索表单组件,支持容器查询自适应布局、展开/收起功能。
npx shadcn@latest add https://codebase.anyask.dev/r/search-form.json
yarn dlx shadcn@latest add https://codebase.anyask.dev/r/search-form.json
pnpm dlx shadcn@latest add https://codebase.anyask.dev/r/search-form.json
bunx shadcn@latest add https://codebase.anyask.dev/r/search-form.json
deno run npm:shadcn@latest npm:add https://codebase.anyask.dev/r/search-form.json
组件使用 容器查询 实现响应式布局,根据父容器宽度自动调整列数。
<640px
≥640px
≥1024px
≥1280px
父容器需要设置 container-type: inline-size 才能生效容器查询。
container-type: inline-size
通过 maxCols prop 限制最大列数,默认 4 列。
maxCols
通过 actions 属性自定义操作按钮区域。
actions
当表单项数量较多时,会自动显示展开/收起按钮。
FormInstance<unknown>
-
string
1 | 2 | 3 | 4
4
number
boolean
true
重置
查询
(values: Record<string, any>) => void
() => void
(props: ActionsRenderProps) => ReactNode
66