Previews

No matching results.

x
1
2
3
4
5
6
7
8
9
10
11
12
13
<div class="form-field-wrapper">
<label for="phone" class="block font-medium text-gray-700 mb-1 text-sm">
Phone Number
</label>
<div class="relative flex items-center">
<div class="absolute inset-y-0 flex items-center pointer-events-none px-4 left-0">
<svg class="h-5 w-5 text-gray-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 5a2 2 0 012-2h3.28a1 1 0 01.948.684l1.498 4.493a1 1 0 01-.502 1.21l-2.257 1.13a11.042 11.042 0 005.516 5.516l1.13-2.257a1 1 0 011.21-.502l4.493 1.498a1 1 0 01.684.949V19a2 2 0 01-2 2h-1C9.716 21 3 14.284 3 6V5z"/>
</svg>
</div>
<input name="phone" placeholder="+1 (555) 000-0000" class="block w-full rounded-md border shadow-sm transition-colors duration-200 text-base py-2 px-4 border-gray-300 bg-white text-gray-900 placeholder-gray-400 focus:border-primary-500 focus:ring-2 focus:ring-primary-500 focus:ring-opacity-20 focus:outline-none pl-10" type="tel" />
</div>
</div>
1
2
3
4
5
6
7
8
9
10
11
12
render BetterUi::Forms::TextInputComponent.new(
name: "phone",
type: :tel,
label: "Phone Number",
placeholder: "+1 (555) 000-0000"
) do |component|
component.with_prefix_icon do
'<svg class="h-5 w-5 text-gray-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 5a2 2 0 012-2h3.28a1 1 0 01.948.684l1.498 4.493a1 1 0 01-.502 1.21l-2.257 1.13a11.042 11.042 0 005.516 5.516l1.13-2.257a1 1 0 011.21-.502l4.493 1.498a1 1 0 01.684.949V19a2 2 0 01-2 2h-1C9.716 21 3 14.284 3 6V5z"/>
</svg>'.html_safe
end
end