# Component/Button/Button
> Props: component-button-button.props.txt
## Examples
### As Child
```tsx
{
render: () => {
return
;
}
}
```
### Base
```tsx
{
args: {
variant: 'filled',
color: 'secondary',
size: 'medium',
children: '버튼'
}
}
```
### Destructive
```tsx
{
render: (args) => {
const button_size_keys = reverse(Object.keys(button_size_css));
return (
{(['filled', 'outlined'] as const).map((variant) => (
{button_size_keys.map((key) => (
{key}
))}
{button_size_keys.map((key) => (
))}
))}
);
},
args: {
color: 'destructive',
size: 'medium',
children: '버튼',
onClick: () => alert('clicked')
}
}
```
### Disabled
```tsx
{
render: (args) => {
const button_size_keys = reverse(Object.keys(button_size_css));
const styles = [
{ variant: 'filled', color: 'primary' },
{ variant: 'outlined', color: 'secondary' },
{ variant: 'filled', color: 'emphasis' },
{ variant: 'outlined', color: 'destructive' },
] as const;
return (
<>
{styles.map(({ variant, color }) => (
{button_size_keys.map((key) => (
))}
))}
>
);
},
args: {
children: '버튼',
rightIcon:
}
}
```
### Disabled With Color
```tsx
{
render: (args) => {
const button_size_keys = reverse(Object.keys(button_size_css));
const styles = [
{ variant: 'filled', color: 'primary' },
{ variant: 'outlined', color: 'secondary' },
{ variant: 'filled', color: 'emphasis' },
{ variant: 'outlined', color: 'destructive' },
] as const;
return (
<>
{styles.map(({ variant, color }) => (
{button_size_keys.map((key) => (
))}
))}
>
);
},
args: {
children: '버튼',
rightIcon:
}
}
```
### Emphasis
```tsx
{
render: (args) => {
const button_size_keys = reverse(Object.keys(button_size_css));
return (
{(['filled', 'outlined'] as const).map((variant) => (
{button_size_keys.map((key) => (
{key}
))}
{button_size_keys.map((key) => (
))}
))}
);
},
args: {
color: 'emphasis',
size: 'medium',
children: '버튼'
}
}
```
### Focus
```tsx
{
render: () => {
const ref = useRef(null);
useEffect(() => {
ref.current?.focus();
}, [ref.current]);
return <>
키보드 Tab키를 눌러서 포커스를 옮겨볼 수 있어요!
>;
}
}
```
### Full Width
```tsx
{
render: (args) => {
const button_size_keys = reverse(Object.keys(button_size_css));
return (
{button_size_keys.map((key) => (
))}
);
},
args: {
children: '버튼',
fill: true,
color: 'primary'
}
}
```
### Left Icon
```tsx
{
render: (args) => {
const button_size_keys = reverse(Object.keys(button_size_css));
return (
<>
{(['primary', 'secondary', 'emphasis'] as const).map((color) => (
{button_size_keys.map((key) => (
))}
))}
>
);
},
args: {
children: '버튼',
leftIcon:
}
}
```
### Left Icon With Color
```tsx
{
render: (args) => {
const button_size_keys = reverse(Object.keys(button_size_css));
return (
<>
{(['primary', 'secondary', 'emphasis'] as const).map((color) => (
{button_size_keys.map((key) => (
))}
))}
>
);
},
args: {
children: '버튼',
leftIcon:
}
}
```
### Loading
```tsx
{
render: (args) => {
const button_size_keys = reverse(Object.keys(button_size_css));
return (
<>
{(['primary', 'secondary', 'emphasis'] as const).map((color) => (
{button_size_keys.map((key) => (
))}
))}
>
);
},
args: {
children: '엑셀 다운로드',
loading: true,
leftIcon: ,
rightIcon:
}
}
```
### Primary
```tsx
{
render: (args) => {
const button_size_keys = reverse(Object.keys(button_size_css));
return (
{(['filled', 'outlined'] as const).map((variant) => (
{button_size_keys.map((key) => (
{key}
))}
{button_size_keys.map((key) => (
))}
))}
);
},
args: {
color: 'primary',
size: 'medium',
children: '버튼'
}
}
```
### Right Icon
```tsx
{
render: (args) => {
const button_size_keys = reverse(Object.keys(button_size_css));
return (
<>
{(['primary', 'secondary', 'emphasis'] as const).map((color) => (
{button_size_keys.map((key) => (
))}
))}
>
);
},
args: {
children: '버튼',
rightIcon:
}
}
```
### Right Icon With Color
```tsx
{
render: (args) => {
const button_size_keys = reverse(Object.keys(button_size_css));
return (
<>
{(['primary', 'secondary', 'emphasis'] as const).map((color) => (
{button_size_keys.map((key) => (
))}
))}
>
);
},
args: {
children: '버튼',
rightIcon:
}
}
```
### Secondary
```tsx
{
render: (args) => {
const button_size_keys = reverse(Object.keys(button_size_css));
return (
{(['filled', 'outlined'] as const).map((variant) => (
{button_size_keys.map((key) => (
{key}
))}
{button_size_keys.map((key) => (
))}
))}
);
},
args: {
color: 'secondary',
size: 'medium',
children: '버튼'
}
}
```