Input

A component that renders a form input field using Medusa's design system.

In this guide, you'll learn how to use the Input component.

Was this example helpful?

Usage#

Code
import { Input } from "@medusajs/ui"
Code
<Input placeholder="Placeholder" id="input-id" />

API Reference#

This component is based on the input element and supports all of its props

PropTypeDefault
size
"small"
|"base"
"base"
Was this helpful?

Examples#

Password#

Was this example helpful?
Was this example helpful?

Disabled#

Was this example helpful?

Small Size#

Was this example helpful?

Controlled#

Was this example helpful?

Error State#

You can leverage the native aria-invalid property to show an error state on your input:

Was this guide helpful?
Ask Anything
Ask any questions about Medusa. Get help with your development.
You can also use the Medusa MCP server in Cursor, VSCode, etc...
FAQ
What is Medusa?
How can I create a module?
How can I create a data model?
How do I create a workflow?
How can I extend a data model in the Product Module?
Recipes
How do I build a marketplace with Medusa?
How do I build digital products with Medusa?
How do I build subscription-based purchases with Medusa?
What other recipes are available in the Medusa documentation?
Chat is cleared on refresh
Line break