Skip to content

Bootstrap 5.0 support

Pre-release
Pre-release
Compare
Choose a tag to compare
@tortuetorche tortuetorche released this 02 Jun 09:22
· 10 commits to master since this release
45d37ae

Added

  • Add Bootstrap 5 floating labels via the floatingLabel() method for <input>, <select> and <textarea> tags

    NOTE: You need to use floating label elements with a vertical_open Former instance!

    Usage with Laravel:

    {!! Former::vertical_open() !!}
        {!!
            Former::text('test-floating-label-ok')
                ->placeholder('dummy placeholder')
                ->floatingLabel()
        !!}
        {!!
            Former::select('users-floating-label')
                ->options(['User One', 'User Two', 'User Three'])
                ->placeholder('Select placeholder')
                ->floatingLabel()
        !!}
        {!!
            Former::textarea('textarea-floating-label')
                ->floatingLabel()
                ->placeholder('dummy placeholder')
        !!}
    {!! Former::close() !!}
    
    {!! Former::vertical_open() !!}
        <div class="row">
            <div class="col">
                {!!
                    Former::text('test-floating-label-one')
                        ->placeholder('dummy placeholder')
                        ->floatingLabel()
                !!}
            </div>
            <div class="col">
                {!!
                    Former::text('test-floating-label-two')
                        ->placeholder('dummy placeholder')
                        ->floatingLabel()
                !!}
            </div>
        </div>
    {!! Former::close() !!}
  • Add the switch markup which is a custom checkbox for Bootstrap 5

    Some use cases with Laravel:

    {!!
        Former::switch('valid_switch_ok')
            ->text('Valid switch OK')
    !!}
    
    {!!
        Former::switches('valid_inline_switches_ok')
            ->switches('first', 'second', 'third', 'fourth')
            ->inline()
    !!}
  • Add removeGroupClass() and removeLabelClass() methods

    Usage with Laravel:

    {!!
        Former::text('test')
            ->removeGroupClass('row')
            ->removeLabelClass('foo')
    !!}

    WARNING: There is a bug in the HTMLObject package!
    See my pull request for more info: Anahkiasen/html-object#34