github formwerkjs/formwerk v0.10.0

latest releases: v0.11.6, v0.11.5, v0.11.4...
5 months ago

💣 Breaking Changes

  • Renamed useDateTimeField to useDateField.
  • Renamed DateTimeFieldProps to DateFieldProps.

🆕 New Features

🕗 Time Field

Time fields with useTimeField are a simpler version of useDateField and they are only concerned with time. They are almost identical to date fields in terms of how to build them.

import { useTimeField, type TimeFieldProps, DateTimeSegment } from '@formwerk/core';

const props = defineProps<TimeFieldProps>();

const { ...api } = useTimeField(props);

📚 Guide and examples

📁 File Fields

import { useFileField, type FileFieldProps, FileEntry } from '@formwerk/core';

const props = defineProps<FileFieldProps>();

const { ...api } = useFileField(props);

This was one of the last missing fields we had to be feature complete for v1.0, the file field is tricky because there is a lot of problems to solve and abstract for, yet they rely heavily on the app you are building.

We took some risks in terms of what to abstract and offer, and we will rely on your feedback to drive it forward with more features or even less. The results of this initial release is a composable that offers the following:

  • Multiple file support.
  • Dropzone implementation support.
  • Picker-mode implementation support.
  • Basic upload interface with cancellation API.
  • Validation with standard schemas or simple required attribute.
  • Preview images and videos with the FileEntry API.

📚 Guide and examples

✨ Improvements

  • form.setErrors can now accept an array of field issues to set errors at once for multiple fields #149 (c49b072)

🩷 New Sponsors

Many thanks for these new sponsors:


As usual, please give these new features a try and your feedback will help shape or re-shape these implementations!

Don't miss a new formwerk release

NewReleases is sending notifications on new releases.