버튼
버튼 (Button)
링크 역할을 하거나 액션을 트리거하는 버튼 요소 컴포넌트예요. 레이블, 색상, 변형, 크기, 아이콘, 아바타, 로딩 상태 등을 지원하며 Nuxt UI에서 가장 자주 쓰이는 버튼 컴포넌트예요.
출처: Nuxt UI
본문
사용법 (Usage)
기본 슬롯을 사용해 Button의 레이블을 설정해요.
<template>
<UButton>
Button
</UButton>
</template>
레이블 (Label)
label prop을 사용해 Button의 레이블을 설정해요.
<template>
<UButton label="Button" />
</template>
색상 (Color)
color prop을 사용해 Button의 색상을 변경해요.
<template>
<UButton color="neutral">
Button
</UButton>
</template>
변형 (Variant)
variant prop을 사용해 Button의 변형을 변경해요.
<template>
<UButton color="neutral" variant="outline">
Button
</UButton>
</template>
크기 (Size)
size prop을 사용해 Button의 크기를 변경해요.
<template>
<UButton size="xl">
Button
</UButton>
</template>
아이콘 (Icon)
icon prop을 사용해 Button 안에 Icon을 표시해요.
<template>
<UButton icon="i-lucide-rocket" size="md" color="primary" variant="solid">
Button
</UButton>
</template>
leading과 trailing prop을 사용해 아이콘 위치를 설정하거나, leading-icon과 trailing-icon prop을 사용해 위치별로 다른 아이콘을 설정할 수 있어요.
<template>
<UButton trailing-icon="i-lucide-arrow-right" size="md">
Button
</UButton>
</template>
label은 prop 또는 슬롯으로 선택사항이므로, Button을 아이콘 전용 버튼으로 사용할 수 있어요.
<template>
<UButton icon="i-lucide-search" size="md" color="primary" variant="solid" />
</template>
아바타 (Avatar)
avatar prop을 사용해 Button 안에 Avatar를 표시해요.
<template>
<UButton :avatar="{
src: 'https://github.com/nuxt.png',
loading: 'lazy'
}" size="md" color="neutral" variant="outline">
Button
</UButton>
</template>
label은 prop 또는 슬롯으로 선택사항이므로, Button을 아바타 전용 버튼으로 사용할 수 있어요.
<template>
<UButton :avatar="{
src: 'https://github.com/nuxt.png',
loading: 'lazy'
}" size="md" color="neutral" variant="outline" />
</template>
링크 (Link)
Link 컴포넌트의 to, target 등 어떤 속성이든 전달할 수 있어요.
<template>
<UButton to="https://github.com/nuxt/ui" target="_blank">
Button
</UButton>
</template>
Button이 링크이거나 active prop을 사용할 때, active-color와 active-variant prop으로 활성 상태를 커스텀할 수 있어요.
<template>
<UButton active color="neutral" variant="outline" active-color="primary" active-variant="solid">
Button
</UButton>
</template>
active-class와 inactive-class prop으로도 활성 상태를 커스텀할 수 있어요.
<template>
<UButton active active-class="font-bold" inactive-class="font-light">
Button
</UButton>
</template>
[!TIP]
이 스타일들을
app.config.ts파일의ui.button.variants.active키에서 전역으로 구성할 수 있어요.export default defineAppConfig({ ui: { button: { variants: { active: { true: { base: 'font-bold' } } } } } })
로딩 (Loading)
loading prop을 사용해 로딩 아이콘을 표시하고 Button을 비활성화해요.
<template>
<UButton loading :trailing="false">
Button
</UButton>
</template>
loading-auto prop을 사용하면 @click promise가 처리되는 동안 로딩 아이콘을 자동으로 표시해요.
<script setup lang="ts">
async function onClick() {
return new Promise<void>(res => setTimeout(res, 1000))
}
</script>
<template>
<UButton loading-auto @click="onClick">
Button
</UButton>
</template>
이것은 Form 컴포넌트와도 함께 동작해요.
<script setup lang="ts">
const state = reactive({ fullName: '' })
async function onSubmit() {
return new Promise<void>(res => setTimeout(res, 1000))
}
async function validate(data: Partial<typeof state>) {
if (!data.fullName?.length) return [{ name: 'fullName', message: 'Required' }]
return []
}
</script>
<template>
<UForm :state="state" :validate="validate" @submit="onSubmit">
<UFormField name="fullName" label="Full name">
<UInput v-model="state.fullName" />
</UFormField>
<UButton type="submit" class="mt-2" loading-auto>
Submit
</UButton>
</UForm>
</template>
로딩 아이콘 (Loading Icon)
loading-icon prop을 사용해 로딩 아이콘을 커스텀해요. 기본값은 i-lucide-loader-circle예요.
<template>
<UButton loading loading-icon="i-lucide-loader">
Button
</UButton>
</template>
Nuxt:
[!TIP] See: /docs/getting-started/integrations/icons/nuxt#theme
You can customize this icon globally in your
app.config.tsunderui.icons.loadingkey.
[!TIP]
이 아이콘은
app.config.ts의ui.icons.loading키에서 전역으로 커스텀할 수 있어요. 자세한 내용은 /docs/getting-started/integrations/icons/nuxt#theme 문서를 참고해 주세요.
Vue:
[!TIP] See: /docs/getting-started/integrations/icons/vue#theme
You can customize this icon globally in your
vite.config.tsunderui.icons.loadingkey.
[!TIP]
이 아이콘은
vite.config.ts의ui.icons.loading키에서 전역으로 커스텀할 수 있어요. 자세한 내용은 /docs/getting-started/integrations/icons/vue#theme 문서를 참고해 주세요.
비활성화 (Disabled)
disabled prop을 사용해 Button을 비활성화해요.
<template>
<UButton disabled>
Button
</UButton>
</template>
예시 (Examples)
class prop
class prop을 사용해 Button의 기본 스타일을 덮어쓸 수 있어요.
<template>
<UButton class="font-bold rounded-full">
Button
</UButton>
</template>
ui prop
ui prop을 사용해 Button의 슬롯 스타일을 덮어쓸 수 있어요.
<template>
<UButton icon="i-lucide-rocket" color="neutral" variant="outline" :ui="{
leadingIcon: 'text-primary'
}">
Button
</UButton>
</template>
API
Props
/**
* Props for the Button component
*/
interface ButtonProps {
label?: string | undefined;
/**
* @default 'primary'
*/
color?: "error" | "primary" | "secondary" | "success" | "info" | "warning" | "neutral" | undefined;
activeColor?: "error" | "primary" | "secondary" | "success" | "info" | "warning" | "neutral" | undefined;
/**
* @default 'solid'
*/
variant?: "solid" | "outline" | "soft" | "subtle" | "ghost" | "link" | undefined;
activeVariant?: "solid" | "outline" | "soft" | "subtle" | "ghost" | "link" | undefined;
/**
* @default 'md'
*/
size?: "xs" | "sm" | "md" | "lg" | "xl" | undefined;
/**
* Render the button with equal padding on all sides.
*/
square?: boolean | undefined;
/**
* Render the button full width.
*/
block?: boolean | undefined;
/**
* Set loading state automatically based on the `@click` promise state
*/
loadingAuto?: boolean | undefined;
onClick?: (event: MouseEvent): void | ((event: MouseEvent) => void)[] | undefined;
ui?: { base?: SlotClass; label?: SlotClass; leadingIcon?: SlotClass; leadingAvatar?: SlotClass; leadingAvatarSize?: SlotClass; trailingIcon?: SlotClass; } | undefined;
/**
* Display an icon based on the `leading` and `trailing` props.
*/
icon?: any;
/**
* Display an avatar on the left side.
*/
avatar?: AvatarProps | undefined;
/**
* When `true`, the icon will be displayed on the left side.
*/
leading?: boolean | undefined;
/**
* Display an icon on the left side.
*/
leadingIcon?: any;
/**
* When `true`, the icon will be displayed on the right side.
*/
trailing?: boolean | undefined;
/**
* Display an icon on the right side.
*/
trailingIcon?: any;
/**
* When `true`, the loading icon will be displayed.
*/
loading?: boolean | undefined;
/**
* The icon when the `loading` prop is `true`.
* @default appConfig.ui.icons.loading
*/
loadingIcon?: any;
/**
* Class to apply when the link is exact active
*/
exactActiveClass?: string | undefined;
/**
* Pass the returned promise of `router.push()` to `document.startViewTransition()` if supported.
*/
viewTransition?: boolean | undefined;
autofocus?: false | true | "true" | "false" | undefined;
disabled?: boolean | undefined;
form?: string | undefined;
formaction?: string | undefined;
formenctype?: string | undefined;
formmethod?: string | undefined;
formnovalidate?: false | true | "true" | "false" | undefined;
formtarget?: string | undefined;
name?: string | undefined;
/**
* The type of the button when not a link.
* @default 'button'
*/
type?: "reset" | "submit" | "button" | undefined;
/**
* The element or component this component should render as when not a link.
* @default 'button'
*/
as?: any;
/**
* Force the link to be active independent of the current route.
*/
active?: boolean | undefined;
// Props inherited from the Link component: https://ui.nuxt.com/docs/components/link
/**
* Route Location the link should navigate to when clicked on.
*/
to?: string | it | et | undefined;
/**
* Class to apply when the link is active
*/
activeClass?: string | undefined;
/**
* Value passed to the attribute `aria-current` when the link is exact active.
* @default `'page'`
*/
ariaCurrentValue?: "page" | "step" | "location" | "date" | "time" | "true" | "false" | undefined;
/**
* Calls `router.replace` instead of `router.push`.
*/
replace?: boolean | undefined;
download?: any;
/**
* An alias for `to`. If used with `to`, `href` will be ignored
*/
href?: string | it | et | undefined;
hreflang?: string | undefined;
media?: string | undefined;
ping?: string | undefined;
/**
* A rel attribute value to apply on the link. Defaults to "noopener noreferrer" for external links.
*/
rel?: null | "noopener" | "noreferrer" | "nofollow" | "sponsored" | "ugc" | string & {} | undefined;
/**
* Where to display the linked URL, as the name for a browsing context.
*/
target?: null | string & {} | "_blank" | "_parent" | "_self" | "_top" | undefined;
referrerpolicy?: "" | "no-referrer" | "no-referrer-when-downgrade" | "origin" | "origin-when-cross-origin" | "same-origin" | "strict-origin" | "strict-origin-when-cross-origin" | "unsafe-url" | undefined;
/**
* Will only be active if the current route is an exact match.
*/
exact?: boolean | undefined;
/**
* Allows controlling how the current route query sets the link as active.
*/
exactQuery?: boolean | "partial" | undefined;
/**
* Will only be active if the current route hash is an exact match.
*/
exactHash?: boolean | undefined;
/**
* The class to apply when the link is inactive.
*/
inactiveClass?: string | undefined;
/**
* Control i18n auto-localization when `@nuxtjs/i18n` is installed.
* - `undefined` / `true` (default): auto-localizes to the current locale using `$localePath`.
* Paths already carrying a locale prefix (from e.g. `switchLocalePath()`) are detected
* and left untouched to prevent double-prefixing.
* - `false`: explicitly disables auto-localization.
* - `string`: localizes to a specific locale (e.g. `'fr'`).
*/
locale?: string | false | true | undefined;
/**
* Forces the link to be considered as external (true) or internal (false). This is helpful to handle edge-cases
*/
external?: boolean | undefined;
/**
* If set to true, no rel attribute will be added to the link
*/
noRel?: boolean | undefined;
/**
* A class to apply to links that have been prefetched.
*/
prefetchedClass?: string | undefined;
/**
* When enabled will prefetch middleware, layouts and payloads of links in the viewport.
*/
prefetch?: boolean | undefined;
/**
* Allows controlling when to prefetch links. By default, prefetch is triggered only on visibility.
*/
prefetchOn?: "visibility" | "interaction" | Partial<{ visibility: boolean; interaction: boolean; }> | undefined;
/**
* Escape hatch to disable `prefetch` attribute.
*/
noPrefetch?: boolean | undefined;
/**
* An option to either add or remove trailing slashes in the `href` for this specific link.
* Overrides the global `trailingSlash` option if provided.
*/
trailingSlash?: "remove" | "append" | undefined;
}
[!NOTE] See: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#attributes
This component also supports all native
<button>HTML attributes.
[!NOTE]
이 컴포넌트는 네이티브
<button>HTML 속성도 모두 지원해요. 자세한 내용은 https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#attributes 문서를 참고해 주세요.
[!NOTE] See: https://github.com/nuxt/ui/blob/v4/src/runtime/components/Link.vue#L13
The
Buttoncomponent extends theLinkcomponent. Check out the source code on GitHub.
[!NOTE]
Button컴포넌트는Link컴포넌트를 확장해요. GitHub의 소스 코드를 확인해 보세요. https://github.com/nuxt/ui/blob/v4/src/runtime/components/Link.vue#L13
Slots
/**
* Slots for the Button component
*/
interface ButtonSlots {
leading(): any;
default(): any;
trailing(): any;
}
테마 (Theme)
export default defineAppConfig({
ui: {
button: {
slots: {
base: [
'rounded-md font-medium inline-flex items-center disabled:cursor-not-allowed aria-disabled:cursor-not-allowed disabled:opacity-75 aria-disabled:opacity-75',
'transition-colors'
],
label: 'truncate',
leadingIcon: 'shrink-0',
leadingAvatar: 'shrink-0',
leadingAvatarSize: '',
trailingIcon: 'shrink-0'
},
variants: {
fieldGroup: {
horizontal: 'not-only:first:rounded-e-none not-only:last:rounded-s-none not-last:not-first:rounded-none focus-visible:z-[1]',
vertical: 'not-only:first:rounded-b-none not-only:last:rounded-t-none not-last:not-first:rounded-none focus-visible:z-[1]'
},
color: {
primary: '',
secondary: '',
success: '',
info: '',
warning: '',
error: '',
neutral: ''
},
variant: {
solid: '',
outline: '',
soft: '',
subtle: '',
ghost: '',
link: ''
},
size: {
xs: {
base: 'px-2 py-1 text-xs gap-1',
leadingIcon: 'size-4',
leadingAvatarSize: '3xs',
trailingIcon: 'size-4'
},
sm: {
base: 'px-2.5 py-1.5 text-xs gap-1.5',
leadingIcon: 'size-4',
leadingAvatarSize: '3xs',
trailingIcon: 'size-4'
},
md: {
base: 'px-2.5 py-1.5 text-sm gap-1.5',
leadingIcon: 'size-5',
leadingAvatarSize: '2xs',
trailingIcon: 'size-5'
},
lg: {
base: 'px-3 py-2 text-sm gap-2',
leadingIcon: 'size-5',
leadingAvatarSize: '2xs',
trailingIcon: 'size-5'
},
xl: {
base: 'px-3 py-2 text-base gap-2',
leadingIcon: 'size-6',
leadingAvatarSize: 'xs',
trailingIcon: 'size-6'
}
},
block: {
true: {
base: 'w-full justify-center',
trailingIcon: 'ms-auto'
}
},
square: {
true: ''
},
leading: {
true: ''
},
trailing: {
true: ''
},
loading: {
true: ''
},
active: {
true: {
base: ''
},
false: {
base: ''
}
}
},
compoundVariants: [
{
color: 'primary',
variant: 'solid',
class: 'text-inverted bg-primary hover:bg-primary/75 active:bg-primary/75 disabled:bg-primary aria-disabled:bg-primary outline-primary/25 focus-visible:outline-3'
},
{
color: 'secondary',
variant: 'solid',
class: 'text-inverted bg-secondary hover:bg-secondary/75 active:bg-secondary/75 disabled:bg-secondary aria-disabled:bg-secondary outline-secondary/25 focus-visible:outline-3'
},
{
color: 'success',
variant: 'solid',
class: 'text-inverted bg-success hover:bg-success/75 active:bg-success/75 disabled:bg-success aria-disabled:bg-success outline-success/25 focus-visible:outline-3'
},
{
color: 'info',
variant: 'solid',
class: 'text-inverted bg-info hover:bg-info/75 active:bg-info/75 disabled:bg-info aria-disabled:bg-info outline-info/25 focus-visible:outline-3'
},
{
color: 'warning',
variant: 'solid',
class: 'text-inverted bg-warning hover:bg-warning/75 active:bg-warning/75 disabled:bg-warning aria-disabled:bg-warning outline-warning/25 focus-visible:outline-3'
},
{
color: 'error',
variant: 'solid',
class: 'text-inverted bg-error hover:bg-error/75 active:bg-error/75 disabled:bg-error aria-disabled:bg-error outline-error/25 focus-visible:outline-3'
},
{
color: 'primary',
variant: 'outline',
class: 'ring ring-inset ring-primary/50 text-primary hover:bg-primary/10 active:bg-primary/10 disabled:bg-transparent aria-disabled:bg-transparent dark:disabled:bg-transparent dark:aria-disabled:bg-transparent outline-primary/25 focus-visible:outline-3 focus-visible:ring-primary'
},
{
color: 'secondary',
variant: 'outline',
class: 'ring ring-inset ring-secondary/50 text-secondary hover:bg-secondary/10 active:bg-secondary/10 disabled:bg-transparent aria-disabled:bg-transparent dark:disabled:bg-transparent dark:aria-disabled:bg-transparent outline-secondary/25 focus-visible:outline-3 focus-visible:ring-secondary'
},
{
color: 'success',
variant: 'outline',
class: 'ring ring-inset ring-success/50 text-success hover:bg-success/10 active:bg-success/10 disabled:bg-transparent aria-disabled:bg-transparent dark:disabled:bg-transparent dark:aria-disabled:bg-transparent outline-success/25 focus-visible:outline-3 focus-visible:ring-success'
},
{
color: 'info',
variant: 'outline',
class: 'ring ring-inset ring-info/50 text-info hover:bg-info/10 active:bg-info/10 disabled:bg-transparent aria-disabled:bg-transparent dark:disabled:bg-transparent dark:aria-disabled:bg-transparent outline-info/25 focus-visible:outline-3 focus-visible:ring-info'
},
{
color: 'warning',
variant: 'outline',
class: 'ring ring-inset ring-warning/50 text-warning hover:bg-warning/10 active:bg-warning/10 disabled:bg-transparent aria-disabled:bg-transparent dark:disabled:bg-transparent dark:aria-disabled:bg-transparent outline-warning/25 focus-visible:outline-3 focus-visible:ring-warning'
},
{
color: 'error',
variant: 'outline',
class: 'ring ring-inset ring-error/50 text-error hover:bg-error/10 active:bg-error/10 disabled:bg-transparent aria-disabled:bg-transparent dark:disabled:bg-transparent dark:aria-disabled:bg-transparent outline-error/25 focus-visible:outline-3 focus-visible:ring-error'
},
{
color: 'primary',
variant: 'soft',
class: 'text-primary bg-primary/10 hover:bg-primary/15 active:bg-primary/15 outline-primary/25 focus-visible:outline-3 disabled:bg-primary/10 aria-disabled:bg-primary/10'
},
{
color: 'secondary',
variant: 'soft',
class: 'text-secondary bg-secondary/10 hover:bg-secondary/15 active:bg-secondary/15 outline-secondary/25 focus-visible:outline-3 disabled:bg-secondary/10 aria-disabled:bg-secondary/10'
},
{
color: 'success',
variant: 'soft',
class: 'text-success bg-success/10 hover:bg-success/15 active:bg-success/15 outline-success/25 focus-visible:outline-3 disabled:bg-success/10 aria-disabled:bg-success/10'
},
{
color: 'info',
variant: 'soft',
class: 'text-info bg-info/10 hover:bg-info/15 active:bg-info/15 outline-info/25 focus-visible:outline-3 disabled:bg-info/10 aria-disabled:bg-info/10'
},
{
color: 'warning',
variant: 'soft',
class: 'text-warning bg-warning/10 hover:bg-warning/15 active:bg-warning/15 outline-warning/25 focus-visible:outline-3 disabled:bg-warning/10 aria-disabled:bg-warning/10'
},
{
color: 'error',
variant: 'soft',
class: 'text-error bg-error/10 hover:bg-error/15 active:bg-error/15 outline-error/25 focus-visible:outline-3 disabled:bg-error/10 aria-disabled:bg-error/10'
},
{
color: 'primary',
variant: 'subtle',
class: 'text-primary ring ring-inset ring-primary/25 bg-primary/10 hover:bg-primary/15 active:bg-primary/15 disabled:bg-primary/10 aria-disabled:bg-primary/10 outline-primary/25 focus-visible:outline-3 focus-visible:ring-primary'
},
{
color: 'secondary',
variant: 'subtle',
class: 'text-secondary ring ring-inset ring-secondary/25 bg-secondary/10 hover:bg-secondary/15 active:bg-secondary/15 disabled:bg-secondary/10 aria-disabled:bg-secondary/10 outline-secondary/25 focus-visible:outline-3 focus-visible:ring-secondary'
},
{
color: 'success',
variant: 'subtle',
class: 'text-success ring ring-inset ring-success/25 bg-success/10 hover:bg-success/15 active:bg-success/15 disabled:bg-success/10 aria-disabled:bg-success/10 outline-success/25 focus-visible:outline-3 focus-visible:ring-success'
},
{
color: 'info',
variant: 'subtle',
class: 'text-info ring ring-inset ring-info/25 bg-info/10 hover:bg-info/15 active:bg-info/15 disabled:bg-info/10 aria-disabled:bg-info/10 outline-info/25 focus-visible:outline-3 focus-visible:ring-info'
},
{
color: 'warning',
variant: 'subtle',
class: 'text-warning ring ring-inset ring-warning/25 bg-warning/10 hover:bg-warning/15 active:bg-warning/15 disabled:bg-warning/10 aria-disabled:bg-warning/10 outline-warning/25 focus-visible:outline-3 focus-visible:ring-warning'
},
{
color: 'error',
variant: 'subtle',
class: 'text-error ring ring-inset ring-error/25 bg-error/10 hover:bg-error/15 active:bg-error/15 disabled:bg-error/10 aria-disabled:bg-error/10 outline-error/25 focus-visible:outline-3 focus-visible:ring-error'
},
{
color: 'primary',
variant: 'ghost',
class: 'text-primary hover:bg-primary/10 active:bg-primary/10 outline-primary/25 focus-visible:outline-3 disabled:bg-transparent aria-disabled:bg-transparent dark:disabled:bg-transparent dark:aria-disabled:bg-transparent'
},
{
color: 'secondary',
variant: 'ghost',
class: 'text-secondary hover:bg-secondary/10 active:bg-secondary/10 outline-secondary/25 focus-visible:outline-3 disabled:bg-transparent aria-disabled:bg-transparent dark:disabled:bg-transparent dark:aria-disabled:bg-transparent'
},
{
color: 'success',
variant: 'ghost',
class: 'text-success hover:bg-success/10 active:bg-success/10 outline-success/25 focus-visible:outline-3 disabled:bg-transparent aria-disabled:bg-transparent dark:disabled:bg-transparent dark:aria-disabled:bg-transparent'
},
{
color: 'info',
variant: 'ghost',
class: 'text-info hover:bg-info/10 active:bg-info/10 outline-info/25 focus-visible:outline-3 disabled:bg-transparent aria-disabled:bg-transparent dark:disabled:bg-transparent dark:aria-disabled:bg-transparent'
},
{
color: 'warning',
variant: 'ghost',
class: 'text-warning hover:bg-warning/10 active:bg-warning/10 outline-warning/25 focus-visible:outline-3 disabled:bg-transparent aria-disabled:bg-transparent dark:disabled:bg-transparent dark:aria-disabled:bg-transparent'
},
{
color: 'error',
variant: 'ghost',
class: 'text-error hover:bg-error/10 active:bg-error/10 outline-error/25 focus-visible:outline-3 disabled:bg-transparent aria-disabled:bg-transparent dark:disabled:bg-transparent dark:aria-disabled:bg-transparent'
},
{
color: 'primary',
variant: 'link',
class: 'text-primary hover:text-primary/75 active:text-primary/75 disabled:text-primary aria-disabled:text-primary outline-primary/25 focus-visible:outline-3'
},
{
color: 'secondary',
variant: 'link',
class: 'text-secondary hover:text-secondary/75 active:text-secondary/75 disabled:text-secondary aria-disabled:text-secondary outline-secondary/25 focus-visible:outline-3'
},
{
color: 'success',
variant: 'link',
class: 'text-success hover:text-success/75 active:text-success/75 disabled:text-success aria-disabled:text-success outline-success/25 focus-visible:outline-3'
},
{
color: 'info',
variant: 'link',
class: 'text-info hover:text-info/75 active:text-info/75 disabled:text-info aria-disabled:text-info outline-info/25 focus-visible:outline-3'
},
{
color: 'warning',
variant: 'link',
class: 'text-warning hover:text-warning/75 active:text-warning/75 disabled:text-warning aria-disabled:text-warning outline-warning/25 focus-visible:outline-3'
},
{
color: 'error',
variant: 'link',
class: 'text-error hover:text-error/75 active:text-error/75 disabled:text-error aria-disabled:text-error outline-error/25 focus-visible:outline-3'
},
{
color: 'neutral',
variant: 'solid',
class: 'text-inverted bg-inverted hover:bg-inverted/90 active:bg-inverted/90 disabled:bg-inverted aria-disabled:bg-inverted outline-inverted/25 focus-visible:outline-3'
},
{
color: 'neutral',
variant: 'outline',
class: 'ring ring-inset ring-accented text-default bg-default hover:bg-elevated active:bg-elevated disabled:bg-default aria-disabled:bg-default outline-inverted/25 focus-visible:outline-3 focus-visible:ring-inverted'
},
{
color: 'neutral',
variant: 'soft',
class: 'text-default bg-elevated hover:bg-accented/75 active:bg-accented/75 outline-inverted/25 focus-visible:outline-3 disabled:bg-elevated aria-disabled:bg-elevated'
},
{
color: 'neutral',
variant: 'subtle',
class: 'ring ring-inset ring-accented text-default bg-elevated hover:bg-accented/75 active:bg-accented/75 disabled:bg-elevated aria-disabled:bg-elevated outline-inverted/25 focus-visible:outline-3 focus-visible:ring-inverted'
},
{
color: 'neutral',
variant: 'ghost',
class: 'text-default hover:bg-elevated active:bg-elevated outline-inverted/25 focus-visible:outline-3 hover:disabled:bg-transparent dark:hover:disabled:bg-transparent hover:aria-disabled:bg-transparent dark:hover:aria-disabled:bg-transparent'
},
{
color: 'neutral',
variant: 'link',
class: 'text-muted hover:text-default active:text-default disabled:text-muted aria-disabled:text-muted outline-inverted/25 focus-visible:outline-3'
},
{
size: 'xs',
square: true,
class: 'p-1'
},
{
size: 'sm',
square: true,
class: 'p-1.5'
},
{
size: 'md',
square: true,
class: 'p-1.5'
},
{
size: 'lg',
square: true,
class: 'p-2'
},
{
size: 'xl',
square: true,
class: 'p-2'
},
{
loading: true,
leading: true,
class: {
leadingIcon: 'animate-spin'
}
},
{
loading: true,
leading: false,
trailing: true,
class: {
trailingIcon: 'animate-spin'
}
}
],
defaultVariants: {
color: 'primary',
variant: 'solid',
size: 'md'
}
}
}
})
변경 내역 (Changelog)
사이트맵 (Sitemap)
전체 사이트맵에서 모든 페이지를 확인할 수 있어요.