使用shadcn 的pagination 组件,封装即可,使用如下。 totalPage > 0 && <CommonPagination pageSize={Number(totalPage)} page={page + 1} setPage={setPage} />shadcn form 被嵌套后自动聚焦第一个元素 SheetContent 上添加 onOpenAutoFocus={(e) => e.preventDefault()}用户离开前弹窗确认 useEffect(() ...
Feat: Render MessageForm with shadcn-ui. #3221 参考: append on useFieldArray #8485 9. react-hook-form 表单第一次change isDirty仍为false "react-hook-form": "^7.53.1", isDirty用来标识表单是手动触发还是由form.reset()等方式触发,但是在第一次手动change表单的时候isDirty为false,这个时候可以结合...
['name', 'The name of the form item', 'String', '-', '-', '-'], ['label', 'The label of the form item', 'String', '-', '-', '-'], ['rules', 'The rules of the form item', 'Array', '-', '-', '-'], ]"> </ApiTable> ## Events <ApiTable title="Form...
errors)) { // Check if state.errors is an array before iterating state.errors.forEach((error) => { form.setError(error.field, { message: error.message }); }); } }, [state?.errors]); return ( <Form {...form}> <form action={formAction} className="space-y-8"> <FormField ...
['label', 'The label of the form item', 'String', '-', '-', '-'], ['description', 'The description of the form item', 'String', '-', '-', '-'], ['rules', 'The rules of the form item', 'Array', '-', '-', '-'], ['validateOnBlur', 'Whether to validate on ...
import{Form,FormControl,FormDescription,FormField,FormItem,FormLabel,FormMessage,}from"@/components/ui/form"importReactfrom'react'import{TagInput}from'@/components/tag-input'constFormSchema=z.object({topics:z.array(z.string()),})const[tags,setTags]=React.useState<string[]>([]);const{setValue...
This project leverages Auto-Form to dynamically render component property forms based on the component definitions zod schema. Currently only these zod types are supported: boolean date number string enum of supported zod types object with properties of the supported zod types array of objects with ...
slider\"\n\nimport { cn } from \"@/lib/utils\"\n\nfunction Slider({\n className,\n defaultValue,\n value,\n min = 0,\n max = 100,\n ...props\n}: React.ComponentProps<typeof SliderPrimitive.Root>) {\n const _values = React.useMemo(\n () =>\n Array.isArray(value)\n ...
Vue port of shadcn-ui. Contribute to h-ecstasy/shadcn-vue development by creating an account on GitHub.
Arrays are not supported as the root element of the form schema. You also can set default value of an array using .default(), but please makesure the array element has same structure with the schema. const formSchema = z.object({ guestListName: z.string(), invitedGuests: z .array( ...