@props([ 'name', 'label' => null, 'type' => 'text', 'hint' => null, ]) @php // $errors is shared on web requests; default it so the component also renders // standalone (e.g. in isolated Blade::render tests). $errors ??= new \Illuminate\Support\ViewErrorBag; $id = $attributes->get('id', $name); $hasError = $errors->has($name); $field = 'block w-full rounded border bg-surface px-3 py-2 text-sm text-ink placeholder:text-faint transition ' .($hasError ? 'border-danger bg-danger-bg' : 'border-line'); @endphp
{{ $hint }}
@endif @error($name){{ $message }}
@enderror