Interactive forms — Note, Input, Confirm, Select, MultiSelect, Text, FilePicker
Form library built on CandyCore + SugarBits. Multi-page Group wizards, six themes, per-field validators, conditional skip predicates. The form is itself a Model — drop it into a Program.
composer require candycore/sugar-prompt
use CandyCore\Prompt\Form;
use CandyCore\Prompt\Field\{Input, Confirm, Select, Note};
$form = Form::new(
Note::new('welcome')
->withTitle('Onboarding')
->withDescription('A few quick questions.'),
Input::new('name')
->withTitle('Your name?')
->withPlaceholder('Ada Lovelace')
->withValidate(fn($v) => strlen($v) >= 2 ? null : 'too short'),
Confirm::new('newsletter')
->withTitle('Subscribe to the newsletter?'),
Select::new('lang')
->withTitle('Favorite language?')
->withOptions('PHP', 'Go', 'Rust', 'Python'),
);
// $form is a CandyCore Model — drop it into a Program.
->withValidate(fn($v) => …) — return null to pass, error string to block submit.Group::new() stacks Forms into a wizard. Conditional ->withSkipFn().$form->getValue('name') after the Program ends — typed value retrieval.VHS-recorded GIFs of every example shipped with the library. Regenerated automatically on every push that touches the source.