# Action Button
URL: /react/components/action-button
Source: https://github.com/daangn/seed-design/blob/dev/docs/content/react/components/action-button.mdx
A basic interaction component that helps users easily perform clear actions.
사용 가능 버전: @seed-design/react@0.0.1, @seed-design/css@0.0.1
## Preview
```tsx
import { ActionButton } from "seed-design/ui/action-button";
export default function ActionButtonPreview() {
return Label;
}
```
## Installation
- npm: npx @seed-design/cli@latest add ui:action-button
- pnpm: pnpm dlx @seed-design/cli@latest add ui:action-button
- yarn: yarn dlx @seed-design/cli@latest add ui:action-button
- bun: bun x @seed-design/cli@latest add ui:action-button
## Props
## 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
The Ghost variant can change the color of labels and icons using the `color` property, and change the font weight using the `fontWeight` property.
```tsx
import { HStack, PrefixIcon, VStack } from "@seed-design/react";
import { ActionButton } from "seed-design/ui/action-button";
import { IconTagFill } from "@karrotmarket/react-monochrome-icon";
export default function ActionButtonGhost() {
return (
} />
Default (fg.neutral)
} />
Neutral Subtle
} />
Brand
Default (Bold)
Medium
Regular
);
}
```
### 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
You can make the button "break out" from the layout using the `bleedX` and `bleedY` properties.
Useful when visually aligning the 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 all sides
);
}
```