PHP code example of norman-huth / nova-radio-field

1. Go to this page and download the library: Download norman-huth/nova-radio-field library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

norman-huth / nova-radio-field example snippets


use NormanHuth\NovaRadioField\Radio;

//..
Radio::make(__('Radio'), 'select')
    ->options([
        'S' => __('Small'),
        'M' => __('Medium'),
        'L' => __('Large'),
    ])

Radio::make(__('Radio'), 'select')
    ->help(__('Help Text'))

Radio::make(__('Radio'), 'select')
    ->radioHelpTexts([
        'S' => __('Select small size'),
        'L' => __('Select large size'),
    ])

Radio::make(__('Radio'), 'select')
    ->default('M')
    
Radio::make(__('Radio'), 'select')
    ->default(function (NovaRequest $request) {
        return $request->user()->group_id;
    }))

Radio::make(__('Radio'), 'select')
    ->inline()

Radio::make(__('Radio'), 'select')
    ->gap(3)

Radio::make(__('Radio'), 'select')
    ->addClasses(['text-center']), 

Radio::make(__('Radio'), 'select')
    ->setClasses(['flex', 'flex-wrap', 'justify-between']), 

Radio::make(__('Radio'), 'select')
    ->addStyles(['max-width' => '25rem']), 

Radio::make(__('Radio'), 'select')
    ->addLabelClasses(['truncate']),

Radio::make(__('Radio'), 'select')
    ->addLabelStyles(['max-width' => '10rem']),

Radio::make(__('Radio'), 'select')
    ->options([
        'S' => __('Small'),
        'M' => __('Medium'),
        'L' => __('Large'),
        'E' => __('Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam'),
        'G' => __('Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam'),
    ])
    ->radioHelpTexts([
        'S' => __('Select small size'),
        'L' => __('Select large size'),
    ])
    ->gap(4)
    ->inline()
    ->addLabelStyles(['width' => '15rem']),

Radio::make(__('Radio'), 'select')
    ->withoutLabel()
    ->addClasses(['py-4'])

Radio::make(__('Radio'), 'select')
    ->title('Select A Size')

Radio::make(__('Radio'), 'select')
    ->addTitleClasses(['pt-2'])

Radio::make(__('Radio'), 'select')
    ->setTitleClasses([])

Radio::make(__('Radio'), 'select')
    ->addTitleStyles(['padding-left: 1rem'])

Radio::make(__('Radio'), 'select')
    ->displayUsingValues()