Button
A Button is a button.
Usage
Copy
import { Button } from "@camome/core/Button";
export default function Default() { return <Button>Button</Button>;}
Variant
Copy
import { Button } from "@camome/core/Button";
import styles from "./Variant.module.scss";
export default function Variant() { return ( <div className={styles.container}> <Button variant="solid">Solid</Button> <Button variant="soft">Soft</Button> <Button variant="outline">Outline</Button> <Button variant="ghost">Ghost</Button> </div> );}
Color scheme
Copy
import { Button } from "@camome/core/Button";
import styles from "./ColorScheme.module.scss";
export default function ColorScheme() { return ( <div className={styles.container}> <Button colorScheme="primary">Primary</Button> <Button colorScheme="neutral">Neutral</Button> <Button colorScheme="info">Info</Button> <Button colorScheme="success">Success</Button> <Button colorScheme="warn">Warn</Button> <Button colorScheme="danger">Danger</Button> </div> );}
Loading
Copy
import { Button } from "@camome/core/Button";import { Spinner } from "@camome/core/Spinner";
export default function Loading() { return ( <Button disabled leftIcon={<Spinner size="sm" />}> Saving... </Button> );}
Disabled
Copy
import { Button } from "@camome/core/Button";
import styles from "./Disabled.module.scss";
export default function Disabled() { return ( <div className={styles.container}> <Button variant="solid" disabled> Solid </Button> <Button variant="soft" disabled> Subtle </Button> <Button variant="outline" disabled> Outline </Button> <Button variant="ghost" disabled> Ghost </Button> </div> );}
Size
Copy
import { Button } from "@camome/core/Button";
import styles from "./Size.module.scss";
export default function Size() { return ( <div className={styles.container}> <Button size="sm">Small</Button> <Button size="md">Medium</Button> <Button size="lg">Large</Button> </div> );}
With icon
Copy
import { ArrowPathIcon, PaperAirplaneIcon, CloudArrowDownIcon, ChatBubbleLeftEllipsisIcon, HeartIcon, TrashIcon,} from "@heroicons/react/24/outline";
import { Button } from "@camome/core/Button";
import styles from "./WithIcon.module.scss";
export default function WithIcon() { return ( <div className={styles.container}> <Button leftIcon={<ArrowPathIcon strokeWidth="2.25" />} size="sm" variant="outline" > Auto-sync </Button> <Button rightIcon={<PaperAirplaneIcon strokeWidth="2.25" />} size="sm" variant="ghost" > Send </Button>
<Button leftIcon={<CloudArrowDownIcon strokeWidth="2.25" />} variant="soft" > Download </Button> <Button rightIcon={<ChatBubbleLeftEllipsisIcon strokeWidth="2.5" />}> Chat with us </Button>
<Button leftIcon={<HeartIcon strokeWidth="2.25" />} size="lg" variant="ghost" colorScheme="success" > Like </Button> <Button rightIcon={<TrashIcon strokeWidth="2" />} size="lg" colorScheme="danger" > Remove </Button> </div> );}