Result
아이콘, 메시지, 다음 동작이 있는 결과 화면입니다.
Try again
We couldn't load this screen. Please check your connection and try again.
가져오기
섹션 제목: “가져오기”import { Result, ResultButton } from "@pelagornis/page/components";위 미리보기는 이 파일을 렌더링한 것입니다. src/components/에 복사해서 시작하세요.
import { Result, ResultButton } from "@pelagornis/page/components";
export default function ResultDemo() { return ( <Result variant="error" title="Try again" description="We couldn't load this screen. Please check your connection and try again." actions={<ResultButton>Try again</ResultButton>} /> );}MDX에서 사용
섹션 제목: “MDX에서 사용”Result는 React 상태를 공유하는 여러 파트로 구성됩니다. MDX에 쓴 자식은 각각 별도 아일랜드로 렌더되므로 파트끼리 연결되지 않습니다. 위 예처럼 .tsx 파일에서 조립한 뒤 그 파일을 가져오세요.
---title: Example---
import ResultExample from "../../components/ResultExample";
<ResultExample client:load />client:load는 페이지 로드 시 아일랜드를 하이드레이트합니다. 페이지 아래쪽 콘텐츠에는 client:visible을 쓰세요.
Markdoc에서 사용
섹션 제목: “Markdoc에서 사용”Markdoc 태그는 Astro 컴포넌트를 렌더하고, 이 컴포넌트는 클라이언트 상태가 필요합니다. 예제를 하이드레이트하는 .astro 파일로 감싼 뒤 그 파일을 태그로 등록하세요.
---import ResultExample from "../ResultExample";---
<ResultExample client:load />import { component, defineMarkdocConfig } from "@astrojs/markdoc/config";import starlightMarkdoc from "@astrojs/starlight-markdoc";import pageMarkdoc from "@pelagornis/page/markdoc";
export default defineMarkdocConfig({ extends: [starlightMarkdoc(), pageMarkdoc()], tags: { "result-example": { render: component("./src/components/markdoc/ResultExample.astro"), selfClosing: true, }, },});{% result-example /%}각 variant prop에 넣을 수 있는 값입니다.
| Prop | 값 |
|---|---|
variant | success info warning error |
컴포넌트를 이루는 부분과 각 부분이 렌더링하는 data-refineui 역할입니다.
| 부분 | 역할 |
|---|---|
root | result |
icon | result-icon |
title | result-title |
description | result-description |
actions | result-actions |
컴포넌트가 스타일하는 상태입니다. 컴포넌트 상태는 data 속성으로 노출됩니다.
키보드
섹션 제목: “키보드”포커스가 있을 때 컴포넌트가 처리하는 키입니다.
- 디자인 가이드와 토큰 상세는 RefineUI · Result를 참고하세요.
- 공통 규칙은 MDX에서 사용과 Markdoc에서 사용을 참고하세요.