📝 docs: add button icon only on component example

This commit is contained in:
Wahyu Kurniawan 2024-02-19 21:16:39 +07:00
parent 7e6b74208d
commit 943d427db1
No known key found for this signature in database
GPG Key ID: 040A1549143A8E33

View File

@ -1,4 +1,5 @@
import { Button } from 'components/shared/Button'; import { Button, ButtonOrLinkProps } from 'components/shared/Button';
import { PlusIcon } from 'components/shared/CustomIcon';
import React from 'react'; import React from 'react';
const Page = () => { const Page = () => {
@ -17,13 +18,55 @@ const Page = () => {
{/* Insert Components here */} {/* Insert Components here */}
<div className="flex flex-col gap-10 items-center justify-between"> <div className="flex flex-col gap-10 items-center justify-between">
<h1 className="text-2xl font-bold">Button</h1> <h1 className="text-2xl font-bold">Button</h1>
<div className="flex gap-10 flex-wrap"> <div className="flex flex-col gap-10">
<Button size="lg" disabled> {['primary', 'secondary', 'tertiary', 'danger'].map(
(variant, index) => (
<div className="flex gap-5 flex-wrap" key={index}>
{['lg', 'md', 'sm', 'xs', 'disabled'].map((size) => (
<Button
leftIcon={<PlusIcon />}
rightIcon={<PlusIcon />}
variant={variant as ButtonOrLinkProps['variant']}
size={
size !== 'disabled'
? (size as ButtonOrLinkProps['size'])
: 'md'
}
key={`${variant}-${size}`}
disabled={size === 'disabled'}
>
Button Button
</Button> </Button>
<Button size="md">Button</Button> ))}
<Button size="sm">Button</Button> </div>
<Button size="xs">Button</Button> ),
)}
{[
'primary',
'secondary',
'tertiary',
'ghost',
'danger',
'danger-ghost',
].map((variant, index) => (
<div className="flex gap-5 flex-wrap" key={index}>
{['lg', 'md', 'sm', 'xs', 'disabled'].map((size) => (
<Button
iconOnly
variant={variant as ButtonOrLinkProps['variant']}
size={
size !== 'disabled'
? (size as ButtonOrLinkProps['size'])
: 'md'
}
key={`${variant}-${size}`}
disabled={size === 'disabled'}
>
<PlusIcon />
</Button>
))}
</div>
))}
</div> </div>
</div> </div>
</div> </div>