Component

Disabled Readonly Input

Input fields with disabled and read-only states for non-editable content

  • Component
  • Tailwind
  • MIT

Preview

Live component

Interactive preview
Open preview
9:41 100%
devsnips.dev/library/tailwind/components/input/disabled-readonly/
fluid · no fixed width 100%
No dependencies Production-ready

Install

Add to your project

terminal
npx devsnips add Tailwind/Components/Input/disabled-readonly
registry path: Tailwind/Components/Input/disabled-readonly

Source

Implementation

code.html
<!-- Disabled Input -->
<div>
  <label class="block text-sm font-medium text-gray-700 mb-1">Account ID</label>
  <input type="text" value="acc_1234567890" disabled class="w-full px-4 py-2.5 bg-gray-100 border border-gray-300 rounded-lg text-gray-500 cursor-not-allowed" />
  <p class="mt-1.5 text-xs text-gray-400">Account ID cannot be changed</p>
</div>

<!-- Read-only Input -->
<div class="mt-6">
  <label class="block text-sm font-medium text-gray-700 mb-1">Invoice Number</label>
  <input type="text" value="INV-2024-001234" readonly class="w-full px-4 py-2.5 bg-gray-50 border border-gray-300 rounded-lg text-gray-700 cursor-default" />
  <p class="mt-1.5 text-xs text-gray-400">Auto-generated invoice number</p>
</div>

<!-- Disabled with Icon -->
<div class="mt-6">
  <label class="block text-sm font-medium text-gray-700 mb-1">API Endpoint</label>
  <div class="relative">
    <div class="absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none">
      <svg class="w-5 h-5 text-gray-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
        <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13.828 10.172a4 4 0 00-5.656 0l-4 4a4 4 0 105.656 5.656l1.102-1.101m-.758-4.899a4 4 0 005.656 0l4-4a4 4 0 00-5.656-5.656l-1.1 1.1" />
      </svg>
    </div>
    <input type="text" value="https://api.example.com/v2" disabled class="w-full pl-10 pr-4 py-2.5 bg-gray-100 border border-gray-300 rounded-lg text-gray-500 cursor-not-allowed" />
  </div>
</div>

<!-- Read-only Floating -->
<div class="mt-6">
  <label class="block text-sm font-medium text-gray-700 mb-1">Subscription Plan</label>
  <div class="relative">
    <input type="text" value="Pro Plan" readonly class="w-full px-4 py-3 pt-5 pb-2 bg-blue-50 border border-blue-200 rounded-xl text-blue-700 font-medium" />
    <span class="absolute left-4 top-2 text-xs text-blue-500 font-medium">Current Plan</span>
  </div>
  <p class="mt-1.5 text-xs text-gray-400">Upgrade or downgrade in Billing settings</p>
</div>
36 lines UTF-8 · LF · Spaces: 2

AI-ready

Available to your agent.

This component is reachable through the DevSnips CLI, MCP server and Skills integrations — one registry, one resource path.

Resource path

devsnips://components/input/disabled-readonly

Continue browsing

View all