-
-
Notifications
You must be signed in to change notification settings - Fork 446
/
Copy pathphoneInput.withHelperText.tsx
57 lines (51 loc) · 1.17 KB
/
phoneInput.withHelperText.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
import { PhoneInput } from "flowbite-react";
import type { CodeData } from "~/components/code-demo";
const code = `
"use client";
import { PhoneInput } from "flowbite-react";
function Component() {
return (
<form className="max-w-sm mx-auto">
<PhoneInput helperText="Select a phone number that matches the format." />
</form>
)
}
`;
const codeRSC = `
function Component() {
return (
<form className="max-w-sm mx-auto">
<PhoneInput helperText="Select a phone number that matches the format." />
</form>
)
}
`;
function Component() {
return (
<form className="mx-auto max-w-sm">
<PhoneInput
pattern="[0-9]{3}-[0-9]{3}-[0-9]{4}"
required
placeholder="123-456-7890"
helperText="Select a phone number that matches the format."
/>
</form>
);
}
export const withHelperText: CodeData = {
type: "single",
code: [
{
fileName: "client",
language: "tsx",
code,
},
{
fileName: "server",
language: "tsx",
code: codeRSC,
},
],
githubSlug: "/phoneInput/phoneInput.withHelperText.tsx",
component: <Component />,
};