[READ-ONLY] Mirror of https://github.com/bombshell-dev/docs. bomb.sh/docs
0

Configure Feed

Select the types of activity you want to include in your feed.

feat: standard schema for validation (#42)

* feat: standard schema for validation

* Apply suggestions from code review

Signed-off-by: Florian Lefebvre <contact@florian-lefebvre.dev>

---------

Signed-off-by: Florian Lefebvre <contact@florian-lefebvre.dev>
Co-authored-by: paul valladares <85648028+dreyfus92@users.noreply.github.com>

authored by

Florian Lefebvre
paul valladares
and committed by
GitHub
(May 28, 2026, 1:47 PM -0500) a6f704e6 5c950997

+14 -2
+12
src/content/docs/clack/guides/best-practices.mdx
··· 53 53 }); 54 54 ``` 55 55 56 + A [Standard Schema](https://github.com/standard-schema/standard-schema) can be used, for example using [Arktype](https://arktype.io/): 57 + 58 + ```ts twoslash 59 + import { text } from '@clack/prompts'; 60 + import { type } from 'arktype'; 61 + 62 + const name = await text({ 63 + message: 'Enter your name (letters only)', 64 + validate: type('string.alpha').describe('Name can only contain letters'), 65 + }); 66 + ``` 67 + 56 68 ### 3. Consistent Messaging 57 69 58 70 Use clear and consistent messaging across your prompts:
+2 -2
src/content/docs/clack/packages/prompts.mdx
··· 130 130 - `placeholder`: A visual hint shown when the field has no content. 131 131 - `defaultValue`: A fallback value returned when the user provides nothing (empty input). 132 132 - `initialValue`: The starting value shown when the prompt first renders. Users can edit this value before submitting. 133 - - `validate`: A function that validates user input. Return a `string` or `Error` to show as a validation error, or `undefined` to accept the result. 133 + - `validate`: A function or a [Standard Schema](https://github.com/standard-schema/standard-schema) that validates user input. If a custom function is given, you should return a `string` or `Error` to show as a validation error, or `undefined` to accept the result.. 134 134 - All [Common Options](#common-options) 135 135 136 136 ### Password Input ··· 163 163 164 164 - `message`: The prompt message or question shown to the user above the input. 165 165 - `mask`: Character to use for masking input. Default: `'▪/•'`. 166 - - `validate`: A function that validates user input. Return a `string` or `Error` to show as a validation error, or `undefined` to accept the result. 166 + - `validate`: A function or a [Standard Schema](https://github.com/standard-schema/standard-schema) that validates user input. If a custom function is given, you should return a `string` or `Error` to show as a validation error, or `undefined` to accept the result. 167 167 - `clearOnError`: When enabled it causes the input to be cleared if/when validation fails. Default: `false`. 168 168 - All [Common Options](#common-options) 169 169