create-wervt 0.2.15 → 0.2.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +2 -0
- package/package.json +2 -2
- package/template/.claude/skills/nuxt-ui/SKILL.md +85 -243
- package/template/.claude/skills/nuxt-ui/references/components.md +184 -313
- package/template/.claude/skills/nuxt-ui/references/guidelines/component-selection.md +124 -0
- package/template/.claude/skills/nuxt-ui/references/guidelines/conventions.md +372 -0
- package/template/.claude/skills/nuxt-ui/references/guidelines/design-system.md +378 -0
- package/template/.claude/skills/nuxt-ui/references/guidelines/forms.md +235 -0
- package/template/.claude/skills/nuxt-ui/references/layouts/chat.md +140 -77
- package/template/.claude/skills/nuxt-ui/references/layouts/dashboard.md +33 -19
- package/template/.claude/skills/nuxt-ui/references/layouts/docs.md +23 -12
- package/template/.claude/skills/nuxt-ui/references/layouts/editor.md +49 -63
- package/template/.claude/skills/nuxt-ui/references/layouts/{page.md → landing.md} +43 -118
- package/template/.claude/skills/nuxt-ui/references/recipes/auth.md +162 -0
- package/template/.claude/skills/nuxt-ui/references/recipes/data-tables.md +249 -0
- package/template/.claude/skills/nuxt-ui/references/recipes/navigation.md +90 -0
- package/template/.claude/skills/nuxt-ui/references/recipes/overlays.md +177 -0
- package/template/.claude/skills/nuxt-ui-mobile/SKILL.md +38 -10
- package/template/.claude/skills/nuxt-ui-mobile/references/identity.md +127 -0
- package/template/.claude/skills/nuxt-ui-mobile/references/patterns.md +1 -0
- package/template/.claude/skills/nuxt-ui-mobile/references/review-checklist.md +14 -6
- package/template/.claude/skills/nuxt-ui-mobile/references/tokens.md +1 -1
- package/template/.claude/skills/nuxt-ui-mobile/template/app/assets/css/main.css +9 -9
- package/template/.claude/skills/nuxt-ui-mobile/template/app/components/mobile/ListSection.vue +7 -3
- package/template/.claude/skills/nuxt-ui-mobile/template/app/components/mobile/NavBar.vue +13 -4
- package/template/.claude/skills/nuxt-ui-mobile/template/nuxt.config.ts +2 -1
- package/template/.claude/skills/wervt-logs/SKILL.md +16 -13
- package/template/AGENTS.md +120 -8
- package/template/golar.config.ts +5 -0
- package/template/package.json +7 -4
- package/template/pnpm-workspace.yaml +2 -0
- package/template/.claude/skills/nuxt-ui/references/composables.md +0 -127
- package/template/.claude/skills/nuxt-ui/references/theming.md +0 -427
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
# Navigation
|
|
2
|
+
|
|
3
|
+
Patterns for headers, sidebars, breadcrumbs, and tab navigation.
|
|
4
|
+
|
|
5
|
+
## Header with mobile menu
|
|
6
|
+
|
|
7
|
+
`UHeader` default slot is desktop nav, `#body` is the mobile menu. Without `#body`, mobile users have no navigation.
|
|
8
|
+
|
|
9
|
+
```vue
|
|
10
|
+
<UHeader>
|
|
11
|
+
<template #title>
|
|
12
|
+
<Logo class="h-6 w-auto" />
|
|
13
|
+
</template>
|
|
14
|
+
|
|
15
|
+
<UNavigationMenu :items="items" />
|
|
16
|
+
|
|
17
|
+
<template #right>
|
|
18
|
+
<UColorModeButton />
|
|
19
|
+
<UButton label="Sign in" color="neutral" variant="ghost" />
|
|
20
|
+
</template>
|
|
21
|
+
|
|
22
|
+
<template #body>
|
|
23
|
+
<UNavigationMenu :items="items" orientation="vertical" class="-mx-2.5" />
|
|
24
|
+
</template>
|
|
25
|
+
</UHeader>
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
> Full app shell example in [landing layout](../layouts/landing.md).
|
|
29
|
+
|
|
30
|
+
## Sidebar navigation (dashboard)
|
|
31
|
+
|
|
32
|
+
See [dashboard layout](../layouts/dashboard.md) for the full sidebar pattern with `UDashboardSidebar` + `UNavigationMenu`. Key points:
|
|
33
|
+
- Pass `:collapsed="collapsed"` to `UNavigationMenu` inside collapsible sidebars
|
|
34
|
+
- Use `NavigationMenuItem[][]` (nested arrays) for separate nav groups
|
|
35
|
+
- Use `#footer` slot for user menu with `UDropdownMenu`
|
|
36
|
+
|
|
37
|
+
## Breadcrumbs
|
|
38
|
+
|
|
39
|
+
```vue
|
|
40
|
+
<script setup lang="ts">
|
|
41
|
+
const route = useRoute()
|
|
42
|
+
|
|
43
|
+
const breadcrumbs = computed(() => {
|
|
44
|
+
const segments = route.path.split('/').filter(Boolean)
|
|
45
|
+
return segments.map((segment, index) => ({
|
|
46
|
+
label: segment.charAt(0).toUpperCase() + segment.slice(1),
|
|
47
|
+
to: '/' + segments.slice(0, index + 1).join('/')
|
|
48
|
+
}))
|
|
49
|
+
})
|
|
50
|
+
</script>
|
|
51
|
+
|
|
52
|
+
<template>
|
|
53
|
+
<UBreadcrumb :items="breadcrumbs" />
|
|
54
|
+
</template>
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
## Tab navigation (within a page)
|
|
58
|
+
|
|
59
|
+
```vue
|
|
60
|
+
<script setup lang="ts">
|
|
61
|
+
const items = [{
|
|
62
|
+
label: 'Overview',
|
|
63
|
+
icon: 'i-lucide-layout-dashboard',
|
|
64
|
+
slot: 'overview' as const
|
|
65
|
+
}, {
|
|
66
|
+
label: 'Activity',
|
|
67
|
+
icon: 'i-lucide-activity',
|
|
68
|
+
slot: 'activity' as const
|
|
69
|
+
}, {
|
|
70
|
+
label: 'Members',
|
|
71
|
+
icon: 'i-lucide-users',
|
|
72
|
+
slot: 'members' as const
|
|
73
|
+
}]
|
|
74
|
+
</script>
|
|
75
|
+
|
|
76
|
+
<template>
|
|
77
|
+
<UTabs :items="items">
|
|
78
|
+
<template #overview>
|
|
79
|
+
<!-- Overview content -->
|
|
80
|
+
</template>
|
|
81
|
+
<template #activity>
|
|
82
|
+
<!-- Activity feed -->
|
|
83
|
+
</template>
|
|
84
|
+
<template #members>
|
|
85
|
+
<!-- Members list -->
|
|
86
|
+
</template>
|
|
87
|
+
</UTabs>
|
|
88
|
+
</template>
|
|
89
|
+
```
|
|
90
|
+
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
# Overlays
|
|
2
|
+
|
|
3
|
+
Patterns for modals, slideovers, drawers, and command palettes.
|
|
4
|
+
|
|
5
|
+
## Confirmation dialog
|
|
6
|
+
|
|
7
|
+
```vue
|
|
8
|
+
<script setup lang="ts">
|
|
9
|
+
const isOpen = ref(false)
|
|
10
|
+
|
|
11
|
+
function confirmDelete() {
|
|
12
|
+
// perform delete
|
|
13
|
+
isOpen.value = false
|
|
14
|
+
}
|
|
15
|
+
</script>
|
|
16
|
+
|
|
17
|
+
<template>
|
|
18
|
+
<UButton label="Delete" color="error" variant="soft" @click="isOpen = true" />
|
|
19
|
+
|
|
20
|
+
<UModal v-model:open="isOpen" title="Delete item" description="This action cannot be undone. Are you sure?" :ui="{ footer: 'justify-end' }">
|
|
21
|
+
<template #footer="{ close }">
|
|
22
|
+
<UButton label="Cancel" color="neutral" variant="outline" @click="close" />
|
|
23
|
+
<UButton label="Delete" color="error" @click="confirmDelete" />
|
|
24
|
+
</template>
|
|
25
|
+
</UModal>
|
|
26
|
+
</template>
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## Programmatic confirmation (useOverlay)
|
|
30
|
+
|
|
31
|
+
Reusable pattern — no template state needed at the call site.
|
|
32
|
+
|
|
33
|
+
```vue [components/ConfirmModal.vue]
|
|
34
|
+
<script setup lang="ts">
|
|
35
|
+
defineProps<{
|
|
36
|
+
title: string
|
|
37
|
+
description?: string
|
|
38
|
+
}>()
|
|
39
|
+
|
|
40
|
+
const emit = defineEmits<{
|
|
41
|
+
close: [confirmed: boolean]
|
|
42
|
+
}>()
|
|
43
|
+
</script>
|
|
44
|
+
|
|
45
|
+
<template>
|
|
46
|
+
<UModal :close="{ onClick: () => emit('close', false) }" :title="title" :description="description">
|
|
47
|
+
<template #footer>
|
|
48
|
+
<UButton label="Cancel" color="neutral" variant="outline" @click="emit('close', false)" />
|
|
49
|
+
<UButton label="Confirm" color="error" @click="emit('close', true)" />
|
|
50
|
+
</template>
|
|
51
|
+
</UModal>
|
|
52
|
+
</template>
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
```ts
|
|
56
|
+
// Usage anywhere
|
|
57
|
+
const overlay = useOverlay()
|
|
58
|
+
const confirm = overlay.create(ConfirmModal)
|
|
59
|
+
|
|
60
|
+
async function deleteItem(item) {
|
|
61
|
+
const instance = confirm.open({
|
|
62
|
+
title: 'Delete item',
|
|
63
|
+
description: `Are you sure you want to delete "${item.name}"?`
|
|
64
|
+
})
|
|
65
|
+
|
|
66
|
+
if (await instance.result) {
|
|
67
|
+
// user confirmed
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
## Form in a slideover
|
|
73
|
+
|
|
74
|
+
```vue
|
|
75
|
+
<script setup lang="ts">
|
|
76
|
+
import * as z from 'zod'
|
|
77
|
+
|
|
78
|
+
const isOpen = ref(false)
|
|
79
|
+
|
|
80
|
+
const schema = z.object({
|
|
81
|
+
name: z.string().min(1),
|
|
82
|
+
email: z.email()
|
|
83
|
+
})
|
|
84
|
+
|
|
85
|
+
type Schema = z.output<typeof schema>
|
|
86
|
+
const state = reactive<Partial<Schema>>({})
|
|
87
|
+
|
|
88
|
+
function onSave() {
|
|
89
|
+
// save user
|
|
90
|
+
isOpen.value = false
|
|
91
|
+
}
|
|
92
|
+
</script>
|
|
93
|
+
|
|
94
|
+
<template>
|
|
95
|
+
<UButton label="Add user" @click="isOpen = true" />
|
|
96
|
+
|
|
97
|
+
<USlideover v-model:open="isOpen" title="Add user" description="Fill in the details below.">
|
|
98
|
+
<template #body>
|
|
99
|
+
<UForm id="user-form" :schema="schema" :state="state" class="space-y-4" @submit="onSave">
|
|
100
|
+
<UFormField name="name" label="Name">
|
|
101
|
+
<UInput v-model="state.name" />
|
|
102
|
+
</UFormField>
|
|
103
|
+
<UFormField name="email" label="Email">
|
|
104
|
+
<UInput v-model="state.email" type="email" />
|
|
105
|
+
</UFormField>
|
|
106
|
+
</UForm>
|
|
107
|
+
</template>
|
|
108
|
+
|
|
109
|
+
<template #footer="{ close }">
|
|
110
|
+
<UButton label="Cancel" color="neutral" variant="outline" @click="close" />
|
|
111
|
+
<UButton type="submit" form="user-form" label="Save" />
|
|
112
|
+
</template>
|
|
113
|
+
</USlideover>
|
|
114
|
+
</template>
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
## Command palette
|
|
118
|
+
|
|
119
|
+
```vue
|
|
120
|
+
<script setup lang="ts">
|
|
121
|
+
const isOpen = ref(false)
|
|
122
|
+
|
|
123
|
+
defineShortcuts({
|
|
124
|
+
meta_k: () => { isOpen.value = true }
|
|
125
|
+
})
|
|
126
|
+
|
|
127
|
+
const groups = [{
|
|
128
|
+
id: 'actions',
|
|
129
|
+
label: 'Actions',
|
|
130
|
+
items: [
|
|
131
|
+
{ label: 'New file', icon: 'i-lucide-file-plus', kbds: ['meta', 'n'], onSelect: () => newFile() },
|
|
132
|
+
{ label: 'New folder', icon: 'i-lucide-folder-plus', onSelect: () => newFolder() }
|
|
133
|
+
]
|
|
134
|
+
}, {
|
|
135
|
+
id: 'navigation',
|
|
136
|
+
label: 'Navigation',
|
|
137
|
+
items: [
|
|
138
|
+
{ label: 'Dashboard', icon: 'i-lucide-house', to: '/dashboard' },
|
|
139
|
+
{ label: 'Settings', icon: 'i-lucide-settings', to: '/settings' }
|
|
140
|
+
]
|
|
141
|
+
}]
|
|
142
|
+
</script>
|
|
143
|
+
|
|
144
|
+
<template>
|
|
145
|
+
<UButton label="Search..." icon="i-lucide-search" color="neutral" variant="outline" @click="isOpen = true" />
|
|
146
|
+
|
|
147
|
+
<UModal v-model:open="isOpen">
|
|
148
|
+
<template #content>
|
|
149
|
+
<UCommandPalette :groups="groups" placeholder="Type a command or search..." close @update:open="isOpen = $event" />
|
|
150
|
+
</template>
|
|
151
|
+
</UModal>
|
|
152
|
+
</template>
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
## Drawer (bottom sheet)
|
|
156
|
+
|
|
157
|
+
```vue
|
|
158
|
+
<script setup lang="ts">
|
|
159
|
+
const isOpen = ref(false)
|
|
160
|
+
</script>
|
|
161
|
+
|
|
162
|
+
<template>
|
|
163
|
+
<UButton label="Options" @click="isOpen = true" />
|
|
164
|
+
|
|
165
|
+
<UDrawer v-model:open="isOpen" title="Options">
|
|
166
|
+
<template #body>
|
|
167
|
+
<div class="space-y-2 p-4">
|
|
168
|
+
<UButton label="Share" icon="i-lucide-share" block variant="ghost" />
|
|
169
|
+
<UButton label="Export" icon="i-lucide-download" block variant="ghost" />
|
|
170
|
+
<USeparator />
|
|
171
|
+
<UButton label="Delete" icon="i-lucide-trash" block variant="ghost" color="error" />
|
|
172
|
+
</div>
|
|
173
|
+
</template>
|
|
174
|
+
</UDrawer>
|
|
175
|
+
</template>
|
|
176
|
+
```
|
|
177
|
+
|
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: nuxt-ui-mobile
|
|
3
|
-
description:
|
|
3
|
+
description: Phone-first setup and design rules for Nuxt UI v4 apps that should feel like real apps from the App Store. iOS interaction patterns from Apple's Human Interface Guidelines (tab bar, large titles, sheets, 44pt controls, safe areas, Liquid-Glass-style bars) plus an own visual identity per app (brand color, tinted neutrals, display type, content-first screens with imagery and cards). Ships a drop-in config and mobile components (TabBar, NavBar with large title, inset grouped lists, action sheet). Use whenever building, restyling or reviewing a Nuxt/Vue + Nuxt UI app, PWA or page that is used mainly on phones.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Nuxt UI Mobile
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
Real apps on the phone (Letterboxd, Revolut, Duolingo, Airbnb, Things) all *behave* like iOS apps: tab bar, large titles, sheets, back swipes, thumb-sized controls. None of them *look* like the Settings app. They have their own color, type, imagery and a home screen full of the person's content. This skill gives you both layers:
|
|
9
|
+
|
|
10
|
+
1. **Mechanics** (Apple's HIG mapped onto Nuxt UI): the config and components in `template/` and the core rules below. Follow them; they're why the app feels native.
|
|
11
|
+
2. **Identity**: the look that makes it *this* app. Decide it before the first screen (see "Identity" below and `references/identity.md`). An app that only has the mechanics looks unfinished, like a prototype of a settings page.
|
|
12
|
+
|
|
13
|
+
Check the result against `references/review-checklist.md`.
|
|
9
14
|
|
|
10
15
|
Companion skills (load when needed, not by default):
|
|
11
16
|
- **nuxt-ui**: component APIs, props, slots, theming mechanics. Use the Nuxt UI MCP (`get-component`) for exact props.
|
|
@@ -21,12 +26,31 @@ Companion skills (load when needed, not by default):
|
|
|
21
26
|
- `app/layouts/default.vue` (tab bar) and `plain.vue` (full-screen flows), plus `app/app.vue` (toasts at the top).
|
|
22
27
|
- `nuxt.config.ts`: `viewport-fit=cover`, scheme-aware `theme-color`, `ui.fonts: false`.
|
|
23
28
|
2. Add the icon set with `vp add @iconify-json/ph` (or `pnpm add`). Phosphor has regular and `-fill` weights, which gives the outline-to-filled switch iOS uses for selected tabs.
|
|
24
|
-
3.
|
|
25
|
-
4. Look at `examples/app/pages/` for
|
|
29
|
+
3. **Give it its own colors.** The template ships iOS blue on iOS gray as a neutral starting point, not as the look. Pick a brand color that fits the app (or use the project's) and a neutral with a slight warm or cool tint, generate palettes as in `references/tokens.md` and set `primary` and `neutral` in `app.config.ts`. Keep iOS blue only when the app really is a plain utility.
|
|
30
|
+
4. Look at `examples/app/pages/` for how the mechanics fit together: list with search and segmented control, detail, settings, an option picker, and a form sheet. They show structure, not the look: their plain grouped lists are right for settings and forms, not for an app's main screens.
|
|
31
|
+
|
|
32
|
+
## Identity
|
|
33
|
+
|
|
34
|
+
Decide this before writing the first screen, in a few lines: who uses the app, what it should feel like, which real app it should stand next to on the home screen. Then make it visible on every screen.
|
|
35
|
+
|
|
36
|
+
- **Start from an archetype** and its reference apps (details and recipes in `references/identity.md`):
|
|
37
|
+
- Collections and media (films, books, recipes, wine): imagery first, poster or cover grids, often dark. Letterboxd, Apple TV, Goodreads.
|
|
38
|
+
- Money and numbers (budgets, splitting, tracking): big bold numbers, cards, small charts, one confident color. Revolut, Splitwise, Copilot.
|
|
39
|
+
- Habits, learning, health: friendly and bright, rounded type, progress rings, streaks, celebration. Duolingo, Streaks, Headspace.
|
|
40
|
+
- People and community (groups, events, clubs): avatars, photos, a feed or upcoming-events cards, warm colors. Meetup, BeReal, Strava.
|
|
41
|
+
- Places and plans (trips, food, bookings): large photos, maps, date chips, warm and inviting. Airbnb, Too Good To Go.
|
|
42
|
+
- Tasks and tools (lists, notes, utilities): calm, lots of white space, one strong accent, crisp type. Things, Bear, Todoist. This is the only one that may stay close to plain iOS.
|
|
43
|
+
- **Home screen = the person's content, with a hero.** The first tab opens on something worth looking at: a greeting or headline number, today's or the next item as a large card, then collections as cards, grids or horizontal carousels. Not an inset grouped list of rows.
|
|
44
|
+
- **Imagery.** Use real-feeling visuals for content: photos or posters (sample data may use image URLs such as `https://picsum.photos/seed/<word>/400/600`), otherwise emoji, colored tiles with an icon, or gradient covers with initials. Every item that has a natural picture gets one.
|
|
45
|
+
- **Type with character.** Keep the iOS text styles for sizes. For titles and big numbers you may use one display font that fits the mood (e.g. a rounded sans for friendly apps, a serif for editorial ones, `font-rounded` costs nothing). Body text stays on the system font.
|
|
46
|
+
- **Color carries the brand.** The primary color may appear on surfaces, not only on buttons: a tinted hero, category colors, progress, selected states, chart lines. Keep interactive elements recognizable (filled or tinted buttons, tinted links) and keep red for destructive.
|
|
47
|
+
- **Light or dark by identity.** Most apps follow the system setting. An app whose identity is dark (media, nightlife, games) may ship dark only; set `colorMode` accordingly and still check contrast.
|
|
48
|
+
- **Small moments of delight**: a press scale on cards (`active:scale-[0.98] transition`), an animated check when something is done, a short celebration on milestones. Respect `prefers-reduced-motion`.
|
|
49
|
+
|
|
26
50
|
|
|
27
51
|
## Core rules
|
|
28
52
|
|
|
29
|
-
These rules are deliberately opinionated. Break one only when the user asks for it.
|
|
53
|
+
These rules are about mechanics and are deliberately opinionated. Break one only when the user asks for it. Where a rule touches the look (type, color), it leaves room for the app's identity.
|
|
30
54
|
|
|
31
55
|
### Structure and navigation
|
|
32
56
|
- **One column on phones.** Never use a hamburger menu or sidebar. Put 2–5 top-level sections in `MobileTabBar`. With more than 5, make one tab a list of the rest.
|
|
@@ -43,22 +67,24 @@ These rules are deliberately opinionated. Break one only when the user asks for
|
|
|
43
67
|
|
|
44
68
|
### Layout
|
|
45
69
|
- 16px side margin (`px-4` / `mx-4`). Content extends behind bars, and every edge respects safe areas. The template handles the bars and sheets. Pages need `min-h-dvh`, never `100vh`.
|
|
46
|
-
- **Inset grouped lists** (`MobileListSection` + `MobileListRow`) for settings, forms
|
|
70
|
+
- **Inset grouped lists** (`MobileListSection` + `MobileListRow`) for settings, forms and metadata. Separators are inset to where the text starts. Rows are at least 44pt. The app's main content (the things it's about) gets cards, grids and carousels instead; see Identity.
|
|
47
71
|
- **Chevron = drill-down only.** Action rows (`@click`) use tinted text and no chevron. Destructive rows use red text and sit in their own section at the bottom.
|
|
48
72
|
- **Thumb zone:** the primary action of a screen sits in the lower half or in the nav bar's trailing slot. Never put a destructive action next to a frequent one.
|
|
49
73
|
- **Hit areas at least 44×44.** The `touch-target` utility, already on every `UButton`, enlarges small icon buttons without changing their visual size.
|
|
50
74
|
- **Limit what's on screen.** Secondary actions go in "…" menus or long-press menus.
|
|
51
75
|
- No nested scroll areas that scroll in the same direction. Horizontal carousels inside vertical scrolling are fine; show part of the next item.
|
|
76
|
+
- Spacing between blocks: `flex flex-col gap-*` on the parent. Not `space-y-*` when a child is a horizontal scroller with `-mb-2 pb-2` (the trick that keeps shadows from being clipped): in Tailwind v4 the child's margin replaces the gap `space-y` gives it, and the block below sticks to it.
|
|
77
|
+
- In sheets and drawers the body already has side padding: `MobileListSection :inset="false"` there.
|
|
52
78
|
|
|
53
79
|
### Type
|
|
54
|
-
- Use
|
|
80
|
+
- Use the iOS text styles for every size: `text-large-title`, `text-title-1/2/3`, `text-headline`, `text-body` (17px, the default), `text-callout`, `text-subhead`, `text-footnote`, `text-caption-1/2`. Never `text-xs`/`text-sm`/`text-2xl` or arbitrary sizes. Body text uses the system font; titles and big numbers may use the app's display font (`font-display`, see `references/identity.md`) or `font-rounded`.
|
|
55
81
|
- Nothing smaller than 11px. No thin or light weights. Build hierarchy with weight and color (`text-highlighted` / `text-default` / `text-muted` / `text-dimmed`), not with many sizes.
|
|
56
82
|
- Let text wrap rather than truncate important content. When space runs out, stack secondary items under the text.
|
|
57
83
|
|
|
58
84
|
### Color
|
|
59
|
-
- **Semantic tokens
|
|
60
|
-
- **
|
|
61
|
-
- Light and dark mode
|
|
85
|
+
- **Semantic tokens in components:** `text-*` (highlighted, default, toned, muted, dimmed), `bg-default` / `bg-grouped` / `bg-cell` / `bg-elevated` / `bg-fill`, `border-default`/`border-separator`, and the Nuxt UI colors (`primary`, `secondary`, `success`, `error`...) with their shades (`bg-primary/10`, `text-primary-600`). No hex values in components. Category colors and gradients come from the palettes in `main.css`, defined once (e.g. a `categoryColor()` helper), not scattered.
|
|
86
|
+
- **The primary color is the brand.** It marks interactive elements and may also tint surfaces that belong to the identity (hero, progress, selected cards, categories). Body text on it must stay readable. Red means destructive or error, nothing else.
|
|
87
|
+
- Light and dark mode both work, following the system setting, unless the identity is dark-only (see Identity). **No in-app theme toggle** (HIG). Never rely on color alone; add an icon or label.
|
|
62
88
|
- `glass` / `glass-bar` / `glass-control` (translucent material) is only for floating UI: tab bar, nav bar and its buttons, menus, toasts. Never for content cards. Menus and popovers have no hard ring, just material and a soft shadow.
|
|
63
89
|
|
|
64
90
|
### Controls
|
|
@@ -77,6 +103,7 @@ These rules are deliberately opinionated. Break one only when the user asks for
|
|
|
77
103
|
- Respect `prefers-reduced-motion` (Nuxt UI already does). Motion is short and purposeful, with no decorative loops.
|
|
78
104
|
|
|
79
105
|
### Writing
|
|
106
|
+
- **Cut taglines, helper text and secondary labels.** A screen says what it is through its title and content, not a sentence explaining it ("Trag Einkäufe ein, und die App rechnet aus …"). If a screen needs them to make sense, fix the layout. Keep the hints that prevent mistakes (an input's format, what a destructive action deletes).
|
|
80
107
|
- Buttons are verbs ("Add Item", "Delete", "Save"), never "OK/Yes/No" when a verb fits. "Cancel" cancels. Title case for buttons, titles and menu items in English; normal German capitalization for German.
|
|
81
108
|
- Say "tap", not "click". Avoid "we", "your" ("Favorites", not "Your Favorites"), and "Oops/Invalid/Error" without an explanation.
|
|
82
109
|
|
|
@@ -87,6 +114,7 @@ The phone layout is the baseline. From `lg` up, you can swap the tab bar for `UD
|
|
|
87
114
|
Test in a 390×844 viewport in light **and** dark mode (Playwright `browser_resize` + `browser_emulate_media`), with real scrolling (large title collapse, glass bars). Open every sheet and menu. Then go through `references/review-checklist.md`. Final check on a real iPhone for safe areas, the keyboard and the 16px zoom rule.
|
|
88
115
|
|
|
89
116
|
## References
|
|
117
|
+
- `references/identity.md`: archetypes with reference apps, and recipes for the look: brand palette, display font, hero header, cover grid, carousel, stat card, progress ring, category chips, celebration.
|
|
90
118
|
- `references/patterns.md`: HIG pattern → Nuxt UI recipe with code (nav bars, sheets, action sheets, alerts, search, lists, forms, menus, undo toasts, loading, swipe actions, tablet adaptation).
|
|
91
119
|
- `references/tokens.md`: every token and override in the template and the reasoning behind it, plus how to rebrand.
|
|
92
120
|
- `references/review-checklist.md`: pass/fail list for reviews.
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
# Identity: looking like a real app
|
|
2
|
+
|
|
3
|
+
The mechanics in `SKILL.md` make an app feel native. This file is about the other half: making it look like *this* app, the way Letterboxd, Revolut or Duolingo look like themselves while all behaving like iOS apps.
|
|
4
|
+
|
|
5
|
+
Decide before the first screen, and write it down in a few lines (a comment in `app.config.ts` is fine):
|
|
6
|
+
- **Archetype** and one or two reference apps.
|
|
7
|
+
- **Colors**: primary (brand), neutral (tint), light/dark.
|
|
8
|
+
- **Type**: system only, `font-rounded`, or a display font for titles and numbers.
|
|
9
|
+
- **Home screen**: what the hero shows, what follows.
|
|
10
|
+
- **Imagery**: what every item shows as its picture.
|
|
11
|
+
|
|
12
|
+
## Archetypes
|
|
13
|
+
|
|
14
|
+
| Archetype | Feels | Reference apps | Home screen | Colors and type |
|
|
15
|
+
|---|---|---|---|---|
|
|
16
|
+
| Collections and media | Rich, immersive | Letterboxd, Apple TV, Goodreads | Recently added as a cover carousel, then lists as cover grids | Often dark-only, one vivid accent (orange, red, green), serif or condensed display |
|
|
17
|
+
| Money and numbers | Confident, precise | Revolut, Splitwise, Copilot | Big balance or total in the hero, then cards with small charts or recent entries | Strong primary (violet, emerald, blue), tabular numbers, bold display sans |
|
|
18
|
+
| Habits, learning, health | Friendly, encouraging | Duolingo, Streaks, Headspace | Today's progress ring or streak as hero, then today's items as large tappable cards | Bright primary (green, orange, purple), `font-rounded`, emoji or illustrations |
|
|
19
|
+
| People and community | Warm, social | Meetup, Strava, BeReal | Next event or newest activity as a big card with avatars, then a feed | Warm primary (coral, amber), photos and avatars everywhere |
|
|
20
|
+
| Places and plans | Inviting | Airbnb, Too Good To Go | Large photo cards, date chips, a map entry | Warm neutrals (`stone`), photo-first, rounded cards |
|
|
21
|
+
| Tasks and tools | Calm, focused | Things, Bear, Todoist | Today's list, generous spacing, quick add | Close to iOS: one strong accent, system font, light |
|
|
22
|
+
|
|
23
|
+
Mix when it fits (a recipe app is media plus a little habit). Only "Tasks and tools" may stay close to the plain template.
|
|
24
|
+
|
|
25
|
+
## Colors
|
|
26
|
+
|
|
27
|
+
The quickest route is Tailwind's palettes, which Nuxt UI takes by name in `app.config.ts`:
|
|
28
|
+
|
|
29
|
+
```ts
|
|
30
|
+
export default defineAppConfig({
|
|
31
|
+
ui: {
|
|
32
|
+
colors: {
|
|
33
|
+
primary: 'orange', // the brand: red, orange, amber, emerald, teal, sky, violet, rose, …
|
|
34
|
+
neutral: 'stone', // warm: stone; cool: slate; plain: zinc; or keep 'ios-gray'
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
})
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
The template's surfaces (`bg-grouped`, `bg-cell`, `bg-default`, fills) follow `neutral`, so a tinted neutral warms or cools the whole app. For an exact brand hex, generate a palette as in `tokens.md`.
|
|
41
|
+
|
|
42
|
+
Category colors (genres, categories, people): one helper, so they stay consistent and work in dark mode.
|
|
43
|
+
|
|
44
|
+
```ts
|
|
45
|
+
// utils/categoryColor.ts
|
|
46
|
+
const COLORS = ['orange', 'sky', 'emerald', 'violet', 'rose', 'amber'] as const
|
|
47
|
+
const CLASSES: Record<(typeof COLORS)[number], string> = {
|
|
48
|
+
orange: 'bg-orange-500/15 text-orange-700 dark:text-orange-300',
|
|
49
|
+
sky: 'bg-sky-500/15 text-sky-700 dark:text-sky-300',
|
|
50
|
+
emerald: 'bg-emerald-500/15 text-emerald-700 dark:text-emerald-300',
|
|
51
|
+
violet: 'bg-violet-500/15 text-violet-700 dark:text-violet-300',
|
|
52
|
+
rose: 'bg-rose-500/15 text-rose-700 dark:text-rose-300',
|
|
53
|
+
amber: 'bg-amber-500/15 text-amber-800 dark:text-amber-300',
|
|
54
|
+
}
|
|
55
|
+
export function categoryColor(key: string) {
|
|
56
|
+
let hash = 0
|
|
57
|
+
for (const char of key) hash = (hash * 31 + char.charCodeAt(0)) | 0
|
|
58
|
+
return CLASSES[COLORS[Math.abs(hash) % COLORS.length]!]
|
|
59
|
+
}
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
Dark-only identity (media, nightlife, games): in `nuxt.config.ts` set `colorMode: { preference: 'dark', fallback: 'dark' }` and both `theme-color` metas to the dark page background.
|
|
63
|
+
|
|
64
|
+
## Display type
|
|
65
|
+
|
|
66
|
+
`font-rounded` (SF Pro Rounded) needs no download and suits friendly apps. For more character, one web font for titles and numbers:
|
|
67
|
+
|
|
68
|
+
```css
|
|
69
|
+
/* main.css, inside @theme */
|
|
70
|
+
--font-display: 'Fraunces', serif; /* editorial; or 'Bricolage Grotesque', 'Outfit', 'DM Serif Display', 'Space Grotesk' */
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
and `ui: { fonts: true }` in `nuxt.config.ts`; @nuxt/fonts finds the family in the CSS, downloads it at build time and serves it from the app. Use it as `font-display` on large titles, hero numbers and card titles, together with the iOS text styles for size (`text-large-title font-display`). Body text, buttons and inputs stay on the system font. Big numbers get `tabular-nums`.
|
|
74
|
+
|
|
75
|
+
## Recipes
|
|
76
|
+
|
|
77
|
+
### Hero header on the home tab
|
|
78
|
+
```vue
|
|
79
|
+
<section class="relative overflow-hidden bg-linear-to-b from-primary/20 to-transparent px-4 pt-[max(env(safe-area-inset-top),1rem)] pb-6">
|
|
80
|
+
<p class="text-subhead text-muted">Guten Abend, Lena</p>
|
|
81
|
+
<p class="font-display text-large-title text-highlighted tabular-nums">42 Filme</p>
|
|
82
|
+
<p class="text-subhead text-muted">dieses Jahr, 6 mehr als 2025</p>
|
|
83
|
+
</section>
|
|
84
|
+
```
|
|
85
|
+
The large title of the nav bar can be dropped on the home tab when the hero carries the title.
|
|
86
|
+
|
|
87
|
+
### Cover carousel and grid
|
|
88
|
+
```vue
|
|
89
|
+
<div class="-mx-4 flex snap-x gap-3 overflow-x-auto px-4 pb-2 [scrollbar-width:none]">
|
|
90
|
+
<NuxtLink v-for="item in recent" :key="item.id" :to="`/items/${item.id}`"
|
|
91
|
+
class="w-28 shrink-0 snap-start transition active:scale-[0.97]">
|
|
92
|
+
<img :src="item.cover" :alt="item.title" class="aspect-2/3 w-full rounded-md object-cover shadow-sm" loading="lazy">
|
|
93
|
+
<p class="mt-1.5 line-clamp-2 text-footnote text-default">{{ item.title }}</p>
|
|
94
|
+
</NuxtLink>
|
|
95
|
+
</div>
|
|
96
|
+
|
|
97
|
+
<div class="grid grid-cols-3 gap-3"><!-- same tiles, wrapped --></div>
|
|
98
|
+
```
|
|
99
|
+
Without a real picture: a gradient tile with the initials or an emoji, `bg-linear-to-br from-primary-400 to-primary-700` plus `categoryColor()` for variety.
|
|
100
|
+
|
|
101
|
+
### Stat card
|
|
102
|
+
```vue
|
|
103
|
+
<div class="rounded-lg bg-cell p-4">
|
|
104
|
+
<p class="text-footnote text-muted">Ausgegeben im Oktober</p>
|
|
105
|
+
<p class="font-display text-title-1 text-highlighted tabular-nums">312,40 €</p>
|
|
106
|
+
<p class="text-footnote text-success">12 % weniger als im September</p>
|
|
107
|
+
</div>
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
### Progress ring
|
|
111
|
+
```vue
|
|
112
|
+
<svg viewBox="0 0 36 36" class="size-16 -rotate-90">
|
|
113
|
+
<circle cx="18" cy="18" r="15.9" fill="none" class="stroke-(--ui-bg-accented)" stroke-width="3.5" />
|
|
114
|
+
<circle cx="18" cy="18" r="15.9" fill="none" class="stroke-primary transition-[stroke-dasharray] duration-500"
|
|
115
|
+
stroke-width="3.5" stroke-linecap="round" :stroke-dasharray="`${progress * 100} 100`" pathLength="100" />
|
|
116
|
+
</svg>
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
### Category chips
|
|
120
|
+
`<span :class="categoryColor(genre)" class="rounded-full px-2.5 py-1 text-footnote font-medium">{{ genre }}</span>`; as filters, a horizontal row above a list, selected one solid primary.
|
|
121
|
+
|
|
122
|
+
### Celebration
|
|
123
|
+
When something meaningful is done (a streak, a goal, the first entry), a short moment: the check scales in (`transition` + `scale-0` → `scale-100`), or a toast with an emoji. Nothing for routine taps; nothing looping; skip it under `prefers-reduced-motion`.
|
|
124
|
+
|
|
125
|
+
## Before you call it done
|
|
126
|
+
|
|
127
|
+
Put the home screen next to the reference app in your head: would someone believe both come from the App Store? If it reads as a list of gray rows with blue text, the identity is missing.
|
|
@@ -79,6 +79,7 @@ Bottom `UDrawer`, with the header built as a 3-column bar:
|
|
|
79
79
|
<template #body>…form…</template>
|
|
80
80
|
</UDrawer>
|
|
81
81
|
```
|
|
82
|
+
The drawer body has its own side padding: lists inside it use `<MobileListSection :inset="false">`, or they end up narrower than the rest of the sheet.
|
|
82
83
|
|
|
83
84
|
- Cancel on the left, the completing action on the right. Never show Done, Cancel and Back together. Multi-step flows replace Cancel with Back from step 2 on.
|
|
84
85
|
- If there are unsaved changes, confirm before the sheet closes, whether by swipe or Cancel. Use an action sheet ("Discard Changes" in red, then "Keep Editing"), not an alert. Set `:dismissible="false"` while dirty and open the action sheet from Cancel.
|
|
@@ -2,6 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
Check at 390×844 in light and dark mode. Every "no" is a finding.
|
|
4
4
|
|
|
5
|
+
## Identity
|
|
6
|
+
- [ ] The app has its own look: a brand primary (not iOS blue unless it's a plain utility), a fitting neutral, and the archetype from `references/identity.md` is recognizable.
|
|
7
|
+
- [ ] The home tab opens on the person's content with a hero (headline number, next or today's item), not on a plain list of rows.
|
|
8
|
+
- [ ] Items with a natural picture show one (photo, cover, emoji or gradient tile).
|
|
9
|
+
- [ ] Next to its reference app, it would pass as an App Store app.
|
|
10
|
+
|
|
5
11
|
## Structure
|
|
6
12
|
- [ ] Top-level sections are in a bottom tab bar (2–5), with no hamburger or sidebar on the phone.
|
|
7
13
|
- [ ] Tabs only navigate; there are no actions in the tab bar.
|
|
@@ -11,17 +17,18 @@ Check at 390×844 in light and dark mode. Every "no" is a finding.
|
|
|
11
17
|
- [ ] Choices about a started action use an action sheet: destructive in red, Cancel last.
|
|
12
18
|
|
|
13
19
|
## Layout and touch
|
|
14
|
-
- [ ] 16px side margins. Nothing sits under the notch, home indicator or bars (safe areas).
|
|
20
|
+
- [ ] 16px side margins. Nothing sits under the notch, home indicator or bars (safe areas), and nav bar buttons don't touch the top edge in a desktop browser either.
|
|
21
|
+
- [ ] Lists in sheets line up with the rest of the sheet (`:inset="false"`). Every block has a gap to the next one, horizontal scrollers included.
|
|
15
22
|
- [ ] Every tap target is at least 44×44, and targets have room between them.
|
|
16
23
|
- [ ] The primary action is reachable with the thumb (lower half or nav bar trailing). Destructive actions aren't next to frequent ones.
|
|
17
|
-
- [ ]
|
|
24
|
+
- [ ] Settings, forms and metadata use inset grouped sections, separators inset to the text, rows at least 44px. Chevrons only on drill-down rows. Main content uses cards, grids or carousels.
|
|
18
25
|
- [ ] No `100vh`. No horizontal page scroll. No nested scroll areas in the same direction.
|
|
19
26
|
|
|
20
27
|
## Type and color
|
|
21
|
-
- [ ] Only iOS text styles (`text-body` etc.), nothing under 11px, no thin or light weights.
|
|
22
|
-
- [ ]
|
|
23
|
-
- [ ]
|
|
24
|
-
- [ ] Works in
|
|
28
|
+
- [ ] Only iOS text styles for sizes (`text-body` etc.), nothing under 11px, no thin or light weights. A display font only on titles and numbers.
|
|
29
|
+
- [ ] Semantic tokens and Nuxt UI colors in components; category colors from one helper; no hex values.
|
|
30
|
+
- [ ] Interactive elements are recognizable; the brand color on surfaces doesn't make text hard to read. Red marks only destructive actions or errors.
|
|
31
|
+
- [ ] Works in light and dark mode following the system (or dark-only by identity), with no in-app theme toggle.
|
|
25
32
|
- [ ] Text contrast is at least 4.5:1. Meaning never depends on color alone.
|
|
26
33
|
- [ ] Glass material only on floating chrome, never on content cards.
|
|
27
34
|
|
|
@@ -40,6 +47,7 @@ Check at 390×844 in light and dark mode. Every "no" is a finding.
|
|
|
40
47
|
- [ ] Animations respect `prefers-reduced-motion`. No decorative loops.
|
|
41
48
|
|
|
42
49
|
## Writing
|
|
50
|
+
- [ ] No taglines, explanatory sentences under titles or labels that repeat what the layout shows.
|
|
43
51
|
- [ ] Buttons are verbs, "Cancel" cancels, no "OK" where a verb fits.
|
|
44
52
|
- [ ] Nav titles are short (under about 15 characters) and never the app name.
|
|
45
53
|
- [ ] No "click", "we", "Oops" or "Invalid". Capitalization is consistent.
|
|
@@ -78,7 +78,7 @@ Dynamic Type "Large" defaults, with iOS points mapped 1:1 to CSS px. Use them as
|
|
|
78
78
|
| Utility | Purpose |
|
|
79
79
|
|---|---|
|
|
80
80
|
| `touch-target` | Invisible 44×44 minimum hit area. Already on every `UButton`. Doesn't override `absolute`/`fixed`/`sticky`. |
|
|
81
|
-
| `pt-safe` / `pb-safe` / `pl-safe` / `pr-safe` | Safe-area padding. Needs `viewport-fit=cover`, which the template sets. |
|
|
81
|
+
| `pt-safe` / `pb-safe` / `pl-safe` / `pr-safe` | Safe-area padding. Needs `viewport-fit=cover`, which the template sets. It is 0 everywhere but a notched iPhone, so anything at the top edge takes `pt-[max(env(safe-area-inset-top),0.5rem)]` instead. |
|
|
82
82
|
| `glass`, `glass-bar`, `glass-control` | See Materials. |
|
|
83
83
|
|
|
84
84
|
## Icons
|
|
@@ -172,9 +172,9 @@
|
|
|
172
172
|
--ui-text-inverted: #fff;
|
|
173
173
|
|
|
174
174
|
--ui-bg: #fff;
|
|
175
|
-
--ui-bg-muted: var(--color-
|
|
176
|
-
--ui-bg-elevated: var(--color-
|
|
177
|
-
--ui-bg-accented: var(--color-
|
|
175
|
+
--ui-bg-muted: var(--ui-color-neutral-50);
|
|
176
|
+
--ui-bg-elevated: var(--ui-color-neutral-100);
|
|
177
|
+
--ui-bg-accented: var(--ui-color-neutral-200);
|
|
178
178
|
--ui-bg-inverted: #000;
|
|
179
179
|
|
|
180
180
|
--ui-border: rgb(60 60 67 / 0.29);
|
|
@@ -182,7 +182,7 @@
|
|
|
182
182
|
--ui-border-accented: rgb(60 60 67 / 0.36);
|
|
183
183
|
--ui-border-inverted: #000;
|
|
184
184
|
|
|
185
|
-
--app-grouped: var(--color-
|
|
185
|
+
--app-grouped: var(--ui-color-neutral-50);
|
|
186
186
|
--app-cell: #fff;
|
|
187
187
|
--app-fill: rgb(118 118 128 / 0.12);
|
|
188
188
|
--app-glass: rgb(255 255 255 / 0.72);
|
|
@@ -200,10 +200,10 @@
|
|
|
200
200
|
--ui-text-inverted: #000;
|
|
201
201
|
|
|
202
202
|
/* sheets, popovers and cells sit on the elevated dark surface; the page itself is pure black */
|
|
203
|
-
--ui-bg: var(--color-
|
|
204
|
-
--ui-bg-muted: var(--color-
|
|
205
|
-
--ui-bg-elevated: var(--color-
|
|
206
|
-
--ui-bg-accented: var(--color-
|
|
203
|
+
--ui-bg: var(--ui-color-neutral-950);
|
|
204
|
+
--ui-bg-muted: var(--ui-color-neutral-900);
|
|
205
|
+
--ui-bg-elevated: var(--ui-color-neutral-800);
|
|
206
|
+
--ui-bg-accented: var(--ui-color-neutral-700);
|
|
207
207
|
--ui-bg-inverted: #fff;
|
|
208
208
|
|
|
209
209
|
--ui-border: rgb(84 84 88 / 0.65);
|
|
@@ -212,7 +212,7 @@
|
|
|
212
212
|
--ui-border-inverted: #fff;
|
|
213
213
|
|
|
214
214
|
--app-grouped: #000;
|
|
215
|
-
--app-cell: var(--color-
|
|
215
|
+
--app-cell: var(--ui-color-neutral-950);
|
|
216
216
|
--app-fill: rgb(118 118 128 / 0.24);
|
|
217
217
|
--app-glass: rgb(37 37 40 / 0.7);
|
|
218
218
|
--app-glass-edge: rgb(255 255 255 / 0.1);
|
package/template/.claude/skills/nuxt-ui-mobile/template/app/components/mobile/ListSection.vue
CHANGED
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
defineProps<{
|
|
2
|
+
withDefaults(defineProps<{
|
|
3
3
|
header?: string
|
|
4
4
|
footer?: string
|
|
5
|
-
|
|
5
|
+
/** Page margin of its own. Turn off where the container already has one (sheets, drawers). */
|
|
6
|
+
inset?: boolean
|
|
7
|
+
}>(), {
|
|
8
|
+
inset: true
|
|
9
|
+
})
|
|
6
10
|
</script>
|
|
7
11
|
|
|
8
12
|
<template>
|
|
9
|
-
<section class="mx-4">
|
|
13
|
+
<section :class="inset && 'mx-4'">
|
|
10
14
|
<h2 v-if="header || $slots.header" class="px-4 pb-1.5 text-footnote text-muted uppercase">
|
|
11
15
|
<slot name="header">
|
|
12
16
|
{{ header }}
|