Fields

Radio

Radio picks one option with all of them on show, inline or stacked.

use Xelqun\Forms\Components\Radio;

Radio::make('type')
    ->options(['individual' => 'Individual', 'business' => 'Business'])
    ->inline();

Descriptions

Radio::make('plan')
    ->options(['free' => 'Free', 'pro' => 'Pro'])
    ->descriptions(['free' => 'For side projects.', 'pro' => 'For teams.']);

Yes and no

Radio::make('feedback')->boolean('Yes, please', 'No, thanks');

Disabling options

Radio::make('plan')
    ->options($plans)
    ->disableOptionWhen(fn (string $value): bool => $value === 'legacy');

The server refuses a disabled option too.