콘텐츠로 이동
Page

Input

오류와 성공 상태가 있는 한 줄 입력입니다.

import { Input } from "@pelagornis/page/components";

위 미리보기는 이 파일을 렌더링한 것입니다. src/components/에 복사해서 시작하세요.

src/components/InputExample.tsx
import { Input, Stack } from "@pelagornis/page/components";
export default function InputDemo() {
return (
<Stack gap="sizeSmall" className="w-full max-w-sm">
<Input placeholder="Default" aria-label="Default" fullWidth />
<Input size="lg" placeholder="Large" aria-label="Large" fullWidth />
<Input error defaultValue="Invalid value" aria-label="Error" fullWidth />
<Input success defaultValue="Looks good" aria-label="Success" fullWidth />
<Input disabled placeholder="Disabled" aria-label="Disabled" fullWidth />
</Stack>
);
}

Input 컴포넌트는 .mdx 페이지에 바로 쓸 수 있습니다. frontmatter 아래에서 가져오세요. 서버에서 렌더링되므로 client 지시어가 필요 없습니다.

src/content/docs/example.mdx
---
title: Example
---
import { Input } from "@pelagornis/page/components";
<Input placeholder="you@example.com" aria-label="Email" />

pageMarkdoc()가 이 컴포넌트의 input 태그를 등록합니다. markdoc.config.mjs에 프리셋을 한 번 추가한 뒤(Markdoc에서 사용 참고), 어느 .mdoc 페이지에서나 태그를 쓰세요.

src/content/docs/example.mdoc
{% input placeholder="you@example.com" ariaLabel="Email" /%}

속성 이름과 값은 React props와 같습니다.

각 variant prop에 넣을 수 있는 값입니다.

Prop값
sizesm md lg

컴포넌트를 이루는 부분과 각 부분이 렌더링하는 data-refineui 역할입니다.

부분역할
rootinput