# Result Section URL: /react/components/result-section Source: https://github.com/daangn/seed-design/blob/dev/docs/content/react/components/result-section.mdx A template that provides results of user actions such as data loading results or whether a user action is complete. It typically occupies the entire screen or a specific area to prompt the next action or guide the current situation. 사용 가능 버전: @seed-design/react@1.1.10, @seed-design/css@1.1.10 ## Preview ```tsx import { IconDiamond } from "@karrotmarket/react-multicolor-icon"; import { VStack, Icon, Box } from "@seed-design/react"; import { ResultSection } from "seed-design/ui/result-section"; export default function ResultSectionPreview() { return ( } size="x10" /> } title="Result title" description="Add a description" primaryActionProps={{ children: "Primary Action", onClick: () => window.alert("Primary Action Clicked"), }} secondaryActionProps={{ children: "Secondary Action", onClick: () => window.alert("Secondary Action Clicked"), }} /> ); } ``` ## Installation - npm: npx @seed-design/cli@latest add ui:result-section - pnpm: pnpm dlx @seed-design/cli@latest add ui:result-section - yarn: yarn dlx @seed-design/cli@latest add ui:result-section - bun: bun x @seed-design/cli@latest add ui:result-section ## Props ## Examples ### Sizes #### Large ```tsx import { VStack } from "@seed-design/react"; import { ResultSection } from "seed-design/ui/result-section"; export default function ResultSectionLarge() { return ( ); } ``` #### Medium ```tsx import { VStack } from "@seed-design/react"; import { ResultSection } from "seed-design/ui/result-section"; export default function ResultSectionMedium() { return ( ); } ``` ### With CTA & Progress Circle ```tsx import { ActionButton } from "seed-design/ui/action-button"; import { AppBar, AppBarMain } from "seed-design/ui/app-bar"; import { AppScreen, AppScreenContent } from "seed-design/ui/app-screen"; import { ProgressCircle } from "seed-design/ui/progress-circle"; import { ResultSection } from "seed-design/ui/result-section"; import { IconExclamationmarkCircleFill } from "@karrotmarket/react-monochrome-icon"; import { Box, Flex, Icon, VStack } from "@seed-design/react"; import { type StaticActivityComponentType } from "@stackflow/react/future"; import { useEffect, useState, type ComponentProps } from "react"; declare module "@stackflow/config" { interface Register { ActivityResultSectionCtaProgressCircle: {}; } } type RefundStatus = "in-progress" | "failed"; const resultSectionProperties = { "in-progress": { title: "환불을 요청하고 있어요", description: "잠시만 기다려주세요", asset: ( ), }, failed: { title: "다시 시도해주세요", description: "환불 요청에 실패했어요", asset: ( } size="x10" color="fg.critical" /> ), }, } satisfies Record>; const ActivityResultSectionCtaProgressCircle: StaticActivityComponentType< "ActivityResultSectionCtaProgressCircle" > = () => { const [refundStatus, setRefundStatus] = useState("in-progress"); useEffect(() => { const timer = setTimeout(() => setRefundStatus("failed"), 3000); return () => clearTimeout(timer); }, []); return ( { setRefundStatus("in-progress"); setTimeout(() => setRefundStatus("failed"), 3000); }} > 다시 시도 ); }; export default ActivityResultSectionCtaProgressCircle; ``` ### Success Example An example of using different Lottie animations in dark and light modes in the Result Section asset area. Refer to [How to Detect Current Theme Information on the Client](/react/getting-started/styling/theming#detecting-current-theme-information-on-the-client) to apply theme-appropriate Lottie animations to the Result Section. ```tsx import dynamic from "next/dynamic"; import { VStack, Box } from "@seed-design/react"; import { ResultSection } from "seed-design/ui/result-section"; import { useTheme } from "@/hooks/useTheme"; const Player = dynamic(() => import("@lottiefiles/react-lottie-player").then((mod) => mod.Player), { ssr: false, }); const LOTTIE_URLS = { light: "https://asset-town.krrt.io/production/motion/bd9f3c71-5b81-40b0-8eea-eeebd668edae/c17fa891bb007b9e4e6b281e483b5491cb905703.json", dark: "https://asset-town.krrt.io/production/motion/19bf4654-5286-4def-a651-c674a20ce1ee/89c9e404edc356cf143dab80b627fde01ed8a8fb.json", }; export default function ResultSectionSuccessWithLottie() { const { userColorScheme } = useTheme(); const lottieUrl = LOTTIE_URLS[userColorScheme]; return ( } title="성공했어요" description="요청이 성공적으로 완료되었습니다" primaryActionProps={{ children: "확인", onClick: () => window.alert("확인 클릭"), }} /> ); } ```