el-schneider/statamic-choices
Statamic Choices adds a flexible Choices fieldtype for defining selectable options with labels and values, making it easy to build configurable select, radio, and checkbox-style fields in the Statamic control panel.
statamic-choices is a Statamic addon (verified against Statamic v5 and v6) distributed as a Composer package. It ships a prebuilt Control Panel Vite bundle, so there is no Node build step on your side.
composer require <vendor>/statamic-choices
public/vendor/statamic-choices/build. The v0.1.1 release adds an automatic publish step during composer install, so a fresh composer require should leave you with a working Control Panel without manual asset commands.config/statamic-choices.php (if published) for option/config defaults.resources/views/ for the fieldtype’s rendering templates.src/Fieldtypes/ for the fieldtype class and its expected option schema.Blueprint-first configuration. Define Choices fields in your blueprint YAML and keep option lists close to the field. This is the normal Statamic workflow and avoids scattering option definitions across PHP and templates.
Reusable option sources. For option sets shared across blueprints, centralise them in config or a small service/provider rather than duplicating YAML. Keep the field’s stored value format (single value vs. array for multiple selections) consistent across blueprints.
Antlers rendering. Treat the field like any other Statamic field: access it through the entry, guard for empty values, and use conditionals for display logic. For multi-select fields, loop over values rather than assuming a scalar.
Programmatic access. In Laravel code, read the field from the entry and use Statamic’s augmented values when you need labels rather than raw stored keys. Keep raw values for persistence and augmented values for presentation.
Validation. Add validation rules in the blueprint or form submission layer that match the field’s cardinality: a single-select field should validate as a scalar, multi-select as an array of allowed options. Validate against the allowed option keys, not labels.
Deployment workflow. Let composer install run normally in your build/deploy pipeline so the packaged Vite assets publish. If your pipeline commits public/vendor, include the published build output; if it doesn’t, ensure the publish step runs on every deploy that refreshes public/vendor.
Local vs. production. Because the package ships a prebuilt Vite bundle, production does not need Node or a frontend build. Local development only needs Composer unless you are overriding the package’s views or assets.
composer install --no-scripts, some CI configurations, and certain deploy tools skip script hooks. If the Control Panel shows Vite manifest not found, verify public/vendor/statamic-choices/build/manifest.json exists and re-run the publish step.public/vendor. If your deploy process cleans generated public assets, the addon’s CP bundle disappears with them. Add an explicit publish step or ensure Composer runs after the clean.public/vendor/statamic-choices/build, you will get asset 404s or manifest errors even though the files exist.composer.json, read release notes before upgrading, and avoid relying on internal classes or view names that are likely to change.php artisan vendor:publish output for the exact tag rather than guessing.vendor/. Re-publish after package upgrades so your overrides stay in sync with upstream changes.public/vendor/statamic-choices/build, check file permissions, clear caches, then hard-refresh the Control Panel.How can I help you explore Laravel packages today?