|
1
|
import { ComponentExample } from "@/components/ComponentExample" |
|
2
|
import { ComponentReference } from "@/components/ComponentReference" |
|
3
|
|
|
4
|
export const metadata = { |
|
5
|
title: `Currency Input`, |
|
6
|
} |
|
7
|
|
|
8
|
# {metadata.title} |
|
9
|
|
|
10
|
A component for rendering form inputs for money amounts, showing the currency in the input. |
|
11
|
|
|
12
|
In this guide, you'll learn how to use the Currency Input component. |
|
13
|
|
|
14
|
<ComponentExample name="currency-input-demo" /> |
|
15
|
|
|
16
|
## Usage |
|
17
|
|
|
18
|
```tsx |
|
19
|
import { CurrencyInput } from "@medusajs/ui" |
|
20
|
``` |
|
21
|
|
|
22
|
```tsx |
|
23
|
<CurrencyInput symbol="$" code="usd" /> |
|
24
|
``` |
|
25
|
|
|
26
|
--- |
|
27
|
|
|
28
|
## API Reference |
|
29
|
|
|
30
|
<ComponentReference mainComponent="CurrencyInput" /> |
|
31
|
|
|
32
|
--- |
|
33
|
|
|
34
|
## Examples |
|
35
|
|
|
36
|
### Controlled Currency Input |
|
37
|
|
|
38
|
<ComponentExample name="currency-input-controlled" /> |
|
39
|
|
|
40
|
### Disabled Currency Input |
|
41
|
|
|
42
|
<ComponentExample name="currency-input-disabled" /> |
|
43
|
|
|
44
|
### Currency Input with Error State |
|
45
|
|
|
46
|
<ComponentExample name="currency-input-error" /> |
|
47
|
|
|
48
|
### Currency Input Sizes |
|
49
|
|
|
50
|
#### Base |
|
51
|
|
|
52
|
<ComponentExample name="currency-input-base" /> |
|
53
|
|
|
54
|
#### Small |
|
55
|
|
|
56
|
<ComponentExample name="currency-input-small" hideFeedback /> |