file: ./content/react/components/action-button.mdx # Action Button 사용자가 특정 액션을 실행할 수 있도록 도와주는 컴포넌트입니다. ```tsx import { ActionButton } from "seed-design/ui/action-button"; export default function ActionButtonPreview() { return 라벨; } ``` ## Installation ```bash npx @seed-design/cli@latest add action-button ``` ```bash pnpm dlx @seed-design/cli@latest add action-button ``` ```bash yarn dlx @seed-design/cli@latest add action-button ``` ```bash bun x @seed-design/cli@latest add action-button ``` ## Props

{"Color of the label and icons inside the button.\nWorks only when "}{"variant"}{" is "}{"ghost"}{"."}

}, variant: { "type": "\"brandSolid\" | \"neutralSolid\" | \"neutralWeak\" | \"criticalSolid\" | \"brandOutline\" | \"neutralOutline\" | \"ghost\"", "default": "brandSolid" }, size: { "type": "\"xsmall\" | \"small\" | \"medium\" | \"large\"", "default": "medium" }, layout: { "type": "\"withText\" | \"iconOnly\"", "default": "withText" }, loading: { "type": "boolean", "default": "false", description: <>

{"버튼에 등록된 비동기 작업이 진행 중임을 사용자에게 알립니다."}

}, disabled: { "type": "boolean", "default": "false", description: <>

{"버튼의 비활성화 여부를 나타냅니다."}

}, asChild: { "type": "boolean", "default": "false", description: <>

{"Whether the element should be rendered as a child of a slot."}

}, flexGrow: { "type": "0 | 1 | (number & {})", "default": undefined }, bleedX: { "type": "0 | \"asPadding\" | Dimension | \"spacingX.betweenChips\" | \"spacingX.globalGutter\" | \"spacingY.componentDefault\" | \"spacingY.navToTitle\" | \"spacingY.screenBottom\" | \"spacingY.betweenText\" | (string & {})", "default": undefined, description: <>

{"Negative x-axis margin to extend the element outside its parent.\nIf set to \"asPadding\", it will use the padding value in the same direction."}

}, bleedY: { "type": "0 | \"asPadding\" | Dimension | \"spacingX.betweenChips\" | \"spacingX.globalGutter\" | \"spacingY.componentDefault\" | \"spacingY.navToTitle\" | \"spacingY.screenBottom\" | \"spacingY.betweenText\" | (string & {})", "default": undefined, description: <>

{"Negative y-axis margin to extend the element outside its parent.\nIf set to \"asPadding\", it will use the padding value in the same direction."}

} }} /> ## Examples ### Brand Solid ```tsx import { ActionButton } from "seed-design/ui/action-button"; export default function ActionButtonBrandSolid() { return 라벨; } ``` ### Neutral Solid ```tsx import { ActionButton } from "seed-design/ui/action-button"; export default function ActionButtonNeutralSolid() { return 라벨; } ``` ### Neutral Weak ```tsx import { ActionButton } from "seed-design/ui/action-button"; export default function ActionButtonNeutralWeak() { return 라벨; } ``` ### Critical Solid ```tsx import { ActionButton } from "seed-design/ui/action-button"; export default function ActionButtonCriticalSolid() { return 라벨; } ``` ### Brand Outline ```tsx import { ActionButton } from "seed-design/ui/action-button"; export default function ActionButtonBrandOutline() { return 라벨; } ``` ### Neutral Outline ```tsx import { ActionButton } from "seed-design/ui/action-button"; export default function ActionButtonNeutralOutline() { return 라벨; } ``` ### Ghost Ghost variant는 `color` 속성을 사용해 레이블과 아이콘의 색상을 변경할 수 있습니다. ```tsx import { HStack, Text, VStack } from "@seed-design/react"; import { ActionButton } from "seed-design/ui/action-button"; export default function ActionButtonGhost() { return ( Default Neutral Subtle Brand ); } ``` ### Icon Only ```tsx import { IconPlusFill } from "@karrotmarket/react-monochrome-icon"; import { Icon } from "@seed-design/react"; import { ActionButton } from "seed-design/ui/action-button"; export default function ActionButtonIconOnly() { return ( } /> ); } ``` ### Prefix Icon ```tsx import { IconPlusFill } from "@karrotmarket/react-monochrome-icon"; import { PrefixIcon } from "@seed-design/react"; import { ActionButton } from "seed-design/ui/action-button"; export default function ActionButtonPrefixIcon() { return ( } /> 라벨 ); } ``` ### Suffix Icon ```tsx import { IconChevronRightFill } from "@karrotmarket/react-monochrome-icon"; import { SuffixIcon } from "@seed-design/react"; import { ActionButton } from "seed-design/ui/action-button"; export default function ActionButtonSuffixIcon() { return ( 라벨 } /> ); } ``` ### Disabled ```tsx import { ActionButton } from "seed-design/ui/action-button"; export default function ActionButtonDisabled() { return 라벨; } ``` ### Loading ```tsx import { useState } from "react"; import { ActionButton } from "seed-design/ui/action-button"; export default function ActionButtonLoading() { const [loading, setLoading] = useState(false); function handleClick() { setLoading(true); setTimeout(() => setLoading(false), 2000); } // 이벤트 핸들링이 필요할 수 있으므로 loading은 disabled를 포함하지 않습니다. 이벤트 발생을 원하지 않는 경우, disabled 속성을 추가해주세요. return ( 시간이 걸리는 액션 ); } ``` ### Bleed `bleedX`, `bleedY` 속성을 사용해 버튼이 레이아웃에서 "빠져나오게" 할 수 있습니다. Ghost variant를 시각적으로 정렬해야 할 때 유용합니다. ```tsx import { HStack, Text, VStack } from "@seed-design/react"; import { ActionButton } from "seed-design/ui/action-button"; export default function ActionButtonBleed() { return ( Bleed Example Bleed Y Bleed Example Bleed X and Y ); } ```