[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.

docs: update `date`, `limit-options`, and `messages` sections (#51)

Co-authored-by: paul valladares <85648028+dreyfus92@users.noreply.github.com>

authored by

Willow (GHOST)
paul valladares
and committed by
GitHub
(Jun 7, 2026, 11:07 PM -0500) 41b53814 c2a42166

+44 -16
+44 -16
src/content/docs/clack/packages/prompts.mdx
··· 476 476 477 477 ### Date input 478 478 479 - `date` returns a `Date` on success or a cancel symbol. Use `format` to pick segment order: `YMD`, `MDY`, or `DMY`. Pass `locale` (BCP 47 string) to derive order and separators from `Intl`, or rely on the format alone. 479 + The `date` prompt provides an interactive date picker, allowing users to navigate between year, month, and day segments and increment/decrement values using keyboard controls. 480 480 481 481 ```ts twoslash 482 - import { date, isCancel } from '@clack/prompts'; 482 + import { date } from '@clack/prompts'; 483 483 484 - const picked = await date({ 485 - message: 'Pick a date', 486 - format: 'YMD', 487 - minDate: new Date('2026-01-01'), 488 - maxDate: new Date('2026-12-31'), 484 + const birthday = await date({ 485 + message: 'Pick your birthday', 486 + minDate: new Date('1900-01-01'), 487 + initialValue: new Date(), 488 + maxDate: new Date(), 489 489 }); 490 - 491 - if (isCancel(picked)) { 492 - process.exit(0); 493 - } 494 - 495 - // picked is a Date 496 490 ``` 497 491 498 - Options include `defaultValue`, `initialValue`, `minDate`, `maxDate`, `validate`, and the usual `signal`, `input`, `output`, and `withGuide` settings. 492 + Options: 493 + 494 + - `message`: The message or question shown to the user above the input. 495 + - `format`: The date format to use (default: based on `locale`). 496 + - `locale`: The [BCP 47 language tag](https://developer.mozilla.org/en-US/docs/Glossary/BCP_47_language_tag) to use for formatting. 497 + - `defaultValue`: The default value returned when the user doesn't select a date. 498 + - `initialValue`: The starting date shown when the prompt first renders. Users can edit this value before submitting. 499 + - `minDate`: The minimum allowed date for validation. 500 + - `maxDate`: The maximum allowed date for validation. 501 + - `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.. 502 + - All [Common Options](#common-options) 499 503 500 504 ### Confirmation 501 505 ··· 701 705 702 706 <pre class="cli-preview"><font color="#555753">┌</font> Welcome to clack</pre> 703 707 708 + Options: 709 + 710 + - All [Common Options](#common-options) 711 + 704 712 ### Outro 705 713 706 714 The `outro` function defines the end of an interaction. ··· 716 724 <font color="#555753">└</font> All operations are finished 717 725 &nbsp;</pre> 718 726 727 + Options: 728 + 729 + - All [Common Options](#common-options) 730 + 719 731 ### Cancel 720 732 721 733 The `cancel` function defines an interruption of an interaction and therefore its end. ··· 723 735 724 736 ```ts twoslash 725 737 import { cancel } from '@clack/prompts'; 738 + import process from 'node:process'; 726 739 727 740 cancel('Installation canceled'); 741 + process.exit(1); 728 742 ``` 729 743 730 744 <pre class="cli-preview"><font color="#555753">└</font> <font color="#CC0000">Installation canceled</font> 731 745 &nbsp;</pre> 746 + 747 + Options: 748 + 749 + - All [Common Options](#common-options) 732 750 733 751 ### Spinner 734 752 ··· 1167 1185 1168 1186 ### limitOptions 1169 1187 1170 - `limitOptions` trims a long option list to what fits the terminal, returning the lines to render and keeping the active index visible—intended for **custom** prompts that mirror Clack’s sliding window (see `@clack/prompts` source). Pass `options`, `cursor`, a `style` callback, optional `maxItems`, `columnPadding`, `rowPadding`, and `output` if not using `stdout`. 1188 + Trims an option list to what fits the terminal, while keeping the active option (cursor) visible using a Clack style sliding window. Returns the lines to render. 1171 1189 1172 1190 ```ts twoslash 1173 1191 import { limitOptions } from '@clack/prompts'; ··· 1177 1195 const lines = limitOptions({ 1178 1196 options, 1179 1197 cursor: 2, 1198 + maxItems: 8, 1180 1199 style: (opt, active) => 1181 1200 active ? styleText('cyan', opt) : styleText('dim', opt), 1182 - maxItems: 8, 1183 1201 }); 1184 1202 ``` 1203 + 1204 + Options: 1205 + 1206 + - `options`: The list of options to display. 1207 + - `cursor`: The index of the currently active/selected option. 1208 + - `style`: A function that styles the given option string. The `active` parameter indicates whether the option is currently selected. 1209 + - `maxItems`: Maximum number of options to display at once (default: `Infinity`). 1210 + - `columnPadding`: Number of columns to reserve for padding (default: `0`). 1211 + - `rowPadding`: Number of rows to reserve for padding (default: `0`). 1212 + - All [Common Options](#common-options)