* docs: create a new UI docs project (#13233) * docs: create a new UI docs project * fix installation errors * docs: migrate UI docs content to new project (#13241) * Fix content * added examples for some components * finish adding examples * lint fix * fix build errors * delete empty files * path fixes + refactor * fix build error
61 lines
1.0 KiB
Plaintext
61 lines
1.0 KiB
Plaintext
import { ComponentExample } from "@/components/ComponentExample"
|
|
import { ComponentReference } from "@/components/ComponentReference"
|
|
|
|
export const metadata = {
|
|
title: `Input`,
|
|
}
|
|
|
|
# {metadata.title}
|
|
|
|
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.
|
|
|
|
<ComponentExample name="input-demo" />
|
|
|
|
## Usage
|
|
|
|
```tsx
|
|
import { Input } from "@medusajs/ui"
|
|
```
|
|
|
|
```tsx
|
|
<Input placeholder="Placeholder" id="input-id" />
|
|
```
|
|
|
|
---
|
|
|
|
## API Reference
|
|
|
|
<ComponentReference mainComponent="Input" />
|
|
|
|
---
|
|
|
|
## Examples
|
|
|
|
### Password
|
|
|
|
<ComponentExample name="input-password" />
|
|
|
|
### Search
|
|
|
|
<ComponentExample name="input-search" />
|
|
|
|
### Disabled
|
|
|
|
<ComponentExample name="input-disabled" />
|
|
|
|
### Small Size
|
|
|
|
<ComponentExample name="input-small" />
|
|
|
|
### Controlled
|
|
|
|
<ComponentExample name="input-controlled" />
|
|
|
|
### Error State
|
|
|
|
You can leverage the native `aria-invalid` property to show an error state on your input:
|
|
|
|
<ComponentExample name="input-error" hideFeedback />
|