mirror of
https://github.com/pacnpal/thrillwiki_django_no_react.git
synced 2025-12-20 17:51:08 -05:00
27 lines
1.4 KiB
HTML
27 lines
1.4 KiB
HTML
{% comment %}
|
|
Input Component - Django Template Version of shadcn/ui Input
|
|
Usage: <c-input type="text" placeholder="Enter text..." name="field_name" />
|
|
{% endcomment %}
|
|
|
|
<input
|
|
type="{{ type|default:'text' }}"
|
|
class="flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 {{ class|default:'' }}"
|
|
{% if name %}name="{{ name }}"{% endif %}
|
|
{% if id %}id="{{ id }}"{% endif %}
|
|
{% if placeholder %}placeholder="{{ placeholder }}"{% endif %}
|
|
{% if value %}value="{{ value }}"{% endif %}
|
|
{% if required %}required{% endif %}
|
|
{% if disabled %}disabled{% endif %}
|
|
{% if readonly %}readonly{% endif %}
|
|
{% if autocomplete %}autocomplete="{{ autocomplete }}"{% endif %}
|
|
{% if x_model %}x-model="{{ x_model }}"{% endif %}
|
|
{% if x_on %}{{ x_on }}{% endif %}
|
|
{% if hx_get %}hx-get="{{ hx_get }}"{% endif %}
|
|
{% if hx_post %}hx-post="{{ hx_post }}"{% endif %}
|
|
{% if hx_target %}hx-target="{{ hx_target }}"{% endif %}
|
|
{% if hx_trigger %}hx-trigger="{{ hx_trigger }}"{% endif %}
|
|
{% if hx_swap %}hx-swap="{{ hx_swap }}"{% endif %}
|
|
{% if hx_include %}hx-include="{{ hx_include }}"{% endif %}
|
|
{{ attrs|default:'' }}
|
|
/>
|