Skip to content

Commit cf545d2

Browse files
committed
feat: Button 컴포넌트에 fullWidth prop 추가하여 전체 너비 지원
1 parent 61fff75 commit cf545d2

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

src/components/ui/Button/Button.css.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,11 @@ export const button = recipe({
6464
borderRadius: radius[160],
6565
},
6666
},
67+
fullWidth: {
68+
true: {
69+
width: "100%",
70+
},
71+
},
6772
},
6873
defaultVariants: {
6974
variant: "primary",

src/components/ui/Button/Button.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,19 @@ type ButtonSize = "small" | "medium" | "large" | "fullWidth";
88
export type ButtonProps = {
99
variant?: ButtonVariant;
1010
size?: ButtonSize;
11+
fullWidth?: boolean;
1112
className?: string;
1213
} & ComponentProps<"button">;
1314

1415
export const Button = ({
1516
children,
1617
variant = "primary",
1718
size = "medium",
19+
fullWidth = false,
1820
className,
1921
...props
2022
}: ButtonProps) => {
21-
const variantClass = button({ variant, size });
23+
const variantClass = button({ variant, size, fullWidth });
2224

2325
return (
2426
<button className={`${variantClass} ${className ?? ""}`} {...props}>

0 commit comments

Comments
 (0)