Skip to content

Template · Forms on shadcn Field + Controller - #7

Open
matyasmihalka wants to merge 4 commits into
coursefrom
template/shadcn-field
Open

matyasmihalka wants to merge 4 commits into
coursefrom
template/shadcn-field

Conversation

@matyasmihalka

@matyasmihalka matyasmihalka commented Oct 12, 2026 •

Copy link
Copy Markdown
Collaborator

Template · improvement to the starter, independent of any seminar. Worth applying to your own repo: later seminars build on it.

Stacked on #8 (Week 3 · Mood on a post); merge that first. The forms in cvičení 4 (13. 10.) are written this way, and it is what shadcn's docs and current agents produce.

Why

shadcn deprecated Form / FormField / FormItem / FormControl / FormMessage in October 2025 in favour of Field. Keeping the old form.tsx would leave you with two ways of writing the same form.

What changes

  • components/ui/field.tsx added: the shadcn registry file, importing cn from @/lib/utils like every other component.
  • components/ui/form.tsx removed.
  • QuackForm, SignInForm, SignUpForm rewritten to React Hook Form Controller + Field / FieldLabel / FieldError, the mood toggle group included.
  • CLAUDE.md: new Forms rule. Controller + field.tsx, QuackForm.tsx is the example, don't add the old Form components.

Checked

  • pnpm check-all passes

🤖 Generated with Claude Code

Quacks can carry a mood (happy, sad, angry, silly), chosen in the new-quack
form and shown in the feed. Adds the Mood enum and migration, API support,
and the shadcn select component.
The mood is now picked from four lucide icon buttons below the textbox.
Swaps the shadcn select component for toggle-group.
…cy Form component

shadcn deprecated Form/FormField/FormItem/FormControl/FormMessage in favour of
Field (Oct 2025). Its docs and current agents now produce the Field pattern,
so the template follows. field.tsx is the registry version with local imports
(the registry file imports cn from an npm package of that name).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant