kithkin/resources/views/components/input/text-label.blade.php

27 lines
967 B
PHP

@props([
'label' => '', // label text
'labelclass' => '', // extra CSS classes for the label
'inputclass' => '', // input classes
'name' => '', // input name
'type' => 'text', // input type (text, url, etc)
'value' => '', // input value
'placeholder' => '', // placeholder text
'style' => '', // raw style string for the input
'required' => false, // true/false or truthy value
'description' => '', // optional descriptive text below the input
])
<label {{ $attributes->class("text-label $labelclass") }}>
<span class="label">{{ $label }}</span>
<x-input.text
:type="$type"
:name="$name"
:value="$value"
:class="$inputclass"
:placeholder="$placeholder"
:style="$style"
:required="$required"
/>
@if($description !== '')<span class="description">{{ $description}}</span>@endif
</label>