Skip to main content

frontend-ui-patterns

Create and update QuickStack frontend pages, React components, forms, dialogs, tables, streaming UI, and Zustand-backed state using the project's established UI conventions. Use when editing frontend files, shadcn/ui composition, react-hook-form + Zod flows, Server Action consumption from client components, or client/server component boundaries.

소스 정보

저장소
biersoeckli/quickstack
최근 소스 활동
2026년 8월 9일 17:04
감지된 SKILL.md 언어
영어
스타
362
포크
36

설치 방법

기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.

소스 파일 검토

설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.

파일 탐색기
2 개 파일

SKILL.md 표시 중

SKILL.md
소스 지침 · 읽기 전용 미리보기
name
frontend-ui-patterns
description
Create and update QuickStack frontend pages, React components, forms, dialogs, tables, streaming UI, and Zustand-backed state using the project's established UI conventions. Use when editing frontend files, shadcn/ui composition, react-hook-form + Zod flows, Server Action consumption from client components, or client/server component boundaries.
# Frontend UI Patterns ## Quick Start For QuickStack frontend work: - Use kebab-case filenames. - Put shadcn/ui primitives in `src/components/ui/`. - Put composed UI in `src/components/custom/`. - Put frontend hooks, helpers, sockets, and Zustand usage in `src/frontend/`. - Co-locate page-specific Server Actions in `actions.ts` beside the consuming page. ## Core Workflow When creating or updating frontend UI: - Decide the boundary first: server pages fetch data and check auth; client components handle interaction. - Build forms with `react-hook-form`, Zod, shadcn `Form`, and shared field wrappers. - Choose the Server Action flow by UI need: `Toast.fromAction()` for immediate feedback, `Actions.run()` for imperatively loaded data, and `useActionState` plus `FormUtils.mapValidationErrorsToForm()` for forms with field errors. - Use Zustand-backed dialogs and stores for reusable or cross-component flows; use local state for page-owned dialogs. - Use `SimpleDataTable` for standard tables before building custom table behavior. - Style with shadcn/ui plus Tailwind utilities and `cn()`. ## Boundary Rules - Use `'use server'` for pages and layouts that fetch data or gate authorization. - Use `'use client'` for dialogs, forms, tables, event handlers, and streaming UI. - Use auth helpers from `action-wrapper.utils.ts` in server components. ## Forms And Actions - Add route-safe validation with shared or local Zod schemas. - With Zod 4 and `zodResolver`, type every form with the schema's input and output types. Import `z` from `"zod"` and use `useForm<z.input<typeof schema>, unknown, z.output<typeof schema>>({ resolver: zodResolver(schema), ... })`. Do not use `z.infer` as the `useForm` field-values type when the schema has coercion, transforms, preprocessors, or defaults. - Map server validation errors back with `FormUtils.mapValidationErrorsToForm(...)`. - Use `SubmitButton` for form submits when possible. ## State, Dialogs, And Streaming - Reuse stores in `src/frontend/states/zustand.states.ts` before adding new ones. - Use `useDialog`, `useConfirmDialog`, and `useInputDialog` for modal flows. - Clean up SSE and socket work with `AbortController` or equivalent effect cleanup. ## Reference See `REFERENCE.md` for concrete examples covering server/client boundaries, auth helpers, forms, Server Actions, Zustand stores, `SimpleDataTable`, dialogs, styling, and real-time UI.
GitHub에서 보기