mirror of
https://github.com/kmc7468/arkvault.git
synced 2025-12-16 06:58:46 +00:00
기본 컴포넌트 추가
This commit is contained in:
28
src/lib/components/buttons/Button.svelte
Normal file
28
src/lib/components/buttons/Button.svelte
Normal file
@@ -0,0 +1,28 @@
|
||||
<script lang="ts">
|
||||
interface Props {
|
||||
children?: any;
|
||||
color?: "primary" | "gray";
|
||||
onclick?: () => void;
|
||||
}
|
||||
|
||||
let { children, color = "primary", onclick }: Props = $props();
|
||||
|
||||
let bgColorStyle = $derived(
|
||||
{
|
||||
primary: "bg-primary-600 active:bg-primary-500",
|
||||
gray: "bg-gray-300 active:bg-gray-400",
|
||||
}[color],
|
||||
);
|
||||
let fontColorStyle = $derived(
|
||||
{
|
||||
primary: "text-white",
|
||||
gray: "text-gray-800",
|
||||
}[color],
|
||||
);
|
||||
</script>
|
||||
|
||||
<button {onclick} class="{bgColorStyle} {fontColorStyle} h-12 rounded-xl font-medium">
|
||||
<div class="h-full w-full p-3 transition active:scale-95">
|
||||
{@render children?.()}
|
||||
</div>
|
||||
</button>
|
||||
Reference in New Issue
Block a user