Input
Input (입력 필드)
Input 컴포넌트는 텍스트를 입력하기 위한 인풋 요소예요. v-model로 값을 제어하고 다양한 타입과 변형을 지원하며, 아이콘·아바타·로딩 표시를 함께 넣을 수 있어요.
출처: Nuxt UI
본문
사용법 (Usage)
v-model 지시자를 사용해 Input의 값을 제어하세요.
<script setup lang="ts">
const value = ref("")
</script>
<template>
<UInput />
</template>
타입 (Type)
type prop으로 입력 타입을 변경할 수 있어요. 기본값은 text예요.
일부 타입은 Checkbox, Radio, InputNumber처럼 개별 컴포넌트로 구현되어 있고, file 같은 다른 타입은 스타일이 적용되어 있어요.
<template>
<UInput type="file" />
</template>
[!NOTE] See: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#input_types
사용 가능한 모든 타입은 MDN Web Docs에서 확인할 수 있어요.
플레이스홀더 (Placeholder)
placeholder prop으로 플레이스홀더 텍스트를 설정할 수 있어요.
<template>
<UInput placeholder="Search..." />
</template>
색상 (Color)
color prop으로 Input이 포커스될 때의 링 색상을 변경할 수 있어요.
<template>
<UInput color="neutral" highlight placeholder="Search..." />
</template>
[!NOTE]
여기서
highlightprop은 포커스 상태를 보여주기 위해 사용돼요. 검증 오류가 발생하면 내부적으로 사용돼요.
변형 (Variant)
variant prop으로 Input의 변형을 변경할 수 있어요.
<template>
<UInput color="neutral" variant="subtle" :highlight="false" placeholder="Search..." />
</template>
크기 (Size)
size prop으로 Input의 크기를 변경할 수 있어요.
<template>
<UInput size="xl" placeholder="Search..." />
</template>
아이콘 (Icon)
icon prop으로 Input 안에 Icon을 표시할 수 있어요.
<template>
<UInput icon="i-lucide-search" size="md" variant="outline" placeholder="Search..." />
</template>
leading과 trailing prop으로 아이콘 위치를 설정하거나, leading-icon과 trailing-icon prop으로 각 위치에 서로 다른 아이콘을 설정할 수 있어요.
<template>
<UInput trailing-icon="i-lucide-at-sign" placeholder="Enter your email" size="md" />
</template>
아바타 (Avatar)
avatar prop으로 Input 안에 Avatar를 표시할 수 있어요.
<template>
<UInput :avatar="{
src: 'https://github.com/nuxt.png',
loading: 'lazy'
}" size="md" variant="outline" placeholder="Search..." />
</template>
로딩 (Loading)
loading prop으로 Input에 로딩 아이콘을 표시할 수 있어요.
<template>
<UInput loading :trailing="false" placeholder="Search..." />
</template>
로딩 아이콘 (Loading Icon)
loading-icon prop으로 로딩 아이콘을 커스터마이즈할 수 있어요. 기본값은 i-lucide-loader-circle이에요.
<template>
<UInput loading loading-icon="i-lucide-loader" placeholder="Search..." />
</template>
Nuxt:
[!TIP] See: /docs/getting-started/integrations/icons/nuxt#theme
이 아이콘은
app.config.ts의ui.icons.loading키에서 전역으로 커스터마이즈할 수 있어요.
Vue:
[!TIP] See: /docs/getting-started/integrations/icons/vue#theme
이 아이콘은
vite.config.ts의ui.icons.loading키에서 전역으로 커스터마이즈할 수 있어요.
비활성화 (Disabled)
disabled prop으로 Input을 비활성화할 수 있어요.
<template>
<UInput disabled placeholder="Search..." />
</template>
예제 (Examples)
지우기 버튼 (With clear button)
#trailing 슬롯 안에 Button을 넣어 Input을 지울 수 있어요.
<script setup lang="ts">
const value = ref('Click to clear')
</script>
<template>
<UInput
v-model="value"
placeholder="Type something..."
:ui="{ trailing: 'pe-1' }"
>
<template v-if="value?.length" #trailing>
<UButton
color="neutral"
variant="link"
size="sm"
icon="i-lucide-circle-x"
aria-label="Clear input"
@click="value = ''"
/>
</template>
</UInput>
</template>
복사 버튼 (With copy button)
#trailing 슬롯 안에 Button을 넣어 값을 클립보드에 복사할 수 있어요.
<script setup lang="ts">
import { useClipboard } from '@vueuse/core'
const value = ref('npx nuxt module add ui')
const { copy, copied } = useClipboard()
</script>
<template>
<UInput
v-model="value"
:ui="{ trailing: 'pr-0.5' }"
>
<template v-if="value?.length" #trailing>
<UTooltip text="Copy to clipboard" :content="{ side: 'right' }">
<UButton
:color="copied ? 'success' : 'neutral'"
variant="link"
size="sm"
:icon="copied ? 'i-lucide-copy-check' : 'i-lucide-copy'"
aria-label="Copy to clipboard"
@click="copy(value)"
/>
</UTooltip>
</template>
</UInput>
</template>
비밀번호 토글 (With password toggle)
#trailing 슬롯 안에 Button을 넣어 비밀번호 표시 여부를 전환할 수 있어요.
<script setup lang="ts">
const show = ref(false)
const password = ref('')
</script>
<template>
<UInput
v-model="password"
placeholder="Password"
:type="show ? 'text' : 'password'"
:ui="{ trailing: 'pe-1' }"
>
<template #trailing>
<UButton
color="neutral"
variant="link"
size="sm"
:icon="show ? 'i-lucide-eye-off' : 'i-lucide-eye'"
:aria-label="show ? 'Hide password' : 'Show password'"
:aria-pressed="show"
aria-controls="password"
@click="show = !show"
/>
</template>
</UInput>
</template>
<style>
/* Hide the password reveal button in Edge */
::-ms-reveal {
display: none;
}
</style>
비밀번호 강도 표시기 (With password strength indicator)
Progress 컴포넌트를 사용해 비밀번호 강도 표시기를 표시할 수 있어요.
<script setup lang="ts">
const show = ref(false)
const password = ref('')
function checkStrength(str: string) {
const requirements = [
{ regex: /.{8,}/, text: 'At least 8 characters' },
{ regex: /\d/, text: 'At least 1 number' },
{ regex: /[a-z]/, text: 'At least 1 lowercase letter' },
{ regex: /[A-Z]/, text: 'At least 1 uppercase letter' }
]
return requirements.map(req => ({ met: req.regex.test(str), text: req.text }))
}
const strength = computed(() => checkStrength(password.value))
const score = computed(() => strength.value.filter(req => req.met).length)
const color = computed(() => {
if (score.value === 0) return 'neutral'
if (score.value <= 1) return 'error'
if (score.value <= 2) return 'warning'
if (score.value === 3) return 'warning'
return 'success'
})
const text = computed(() => {
if (score.value === 0) return 'Enter a password'
if (score.value <= 2) return 'Weak password'
if (score.value === 3) return 'Medium password'
return 'Strong password'
})
</script>
<template>
<div class="space-y-2">
<UFormField label="Password">
<UInput
v-model="password"
placeholder="Password"
:color="color"
:type="show ? 'text' : 'password'"
:aria-invalid="score < 4"
aria-describedby="password-strength"
:ui="{ trailing: 'pe-1' }"
class="w-full"
>
<template #trailing>
<UButton
color="neutral"
variant="link"
size="sm"
:icon="show ? 'i-lucide-eye-off' : 'i-lucide-eye'"
:aria-label="show ? 'Hide password' : 'Show password'"
:aria-pressed="show"
aria-controls="password"
@click="show = !show"
/>
</template>
</UInput>
</UFormField>
<UProgress
:color="color"
:indicator="text"
:model-value="score"
:max="4"
size="sm"
/>
<p id="password-strength" class="text-sm font-medium">
{{ text }}. Must contain:
</p>
<ul class="space-y-1" aria-label="Password requirements">
<li
v-for="(req, index) in strength"
:key="index"
class="flex items-center gap-0.5"
:class="req.met ? 'text-success' : 'text-muted'"
>
<UIcon :name="req.met ? 'i-lucide-circle-check' : 'i-lucide-circle-x'" class="size-4 shrink-0" />
<span class="text-xs font-light">
{{ req.text }}
<span class="sr-only">
{{ req.met ? ' - Requirement met' : ' - Requirement not met' }}
</span>
</span>
</li>
</ul>
</div>
</template>
글자 수 제한 (With character limit)
#trailing 슬롯을 사용해 Input에 글자 수 제한을 추가할 수 있어요.
<script setup lang="ts">
const value = ref('')
const maxLength = 15
</script>
<template>
<UInput
v-model="value"
:maxlength="maxLength"
aria-describedby="character-count"
:ui="{ trailing: 'pointer-events-none' }"
>
<template #trailing>
<div
id="character-count"
class="text-xs text-muted tabular-nums"
aria-live="polite"
role="status"
>
{{ value?.length }}/{{ maxLength }}
</div>
</template>
</UInput>
</template>
키보드 단축키 (With keyboard shortcut)
#trailing 슬롯 안에 Kbd 컴포넌트를 사용해 Input에 키보드 단축키를 추가할 수 있어요.
<script setup lang="ts">
const input = useTemplateRef('input')
defineShortcuts({
'/': () => {
input.value?.inputRef?.focus()
}
})
</script>
<template>
<UInput
ref="input"
icon="i-lucide-search"
placeholder="Search..."
>
<template #trailing>
<UKbd value="/" />
</template>
</UInput>
</template>
[!NOTE] See: /docs/composables/define-shortcuts
이 예제는
/키를 누르면 Input을 포커스하기 위해defineShortcuts컴포저블을 사용해요.
마스크 (With mask)
마스크에 대한 내장 지원은 없지만, maska 같은 라이브러리를 사용해 Input을 마스킹할 수 있어요.
<script setup lang="ts">
import { vMaska } from 'maska/vue'
</script>
<template>
<div class="flex flex-col gap-2">
<UInput v-maska="'#### #### #### ####'" placeholder="4242 4242 4242 4242" icon="i-lucide-credit-card" />
<div class="flex items-center gap-2">
<UInput v-maska="'##/##'" placeholder="MM/YY" icon="i-lucide-calendar" />
<UInput v-maska="'###'" placeholder="CVC" />
</div>
</div>
</template>
플로팅 라벨 (With floating label)
#default 슬롯을 사용해 Input에 플로팅 라벨을 추가할 수 있어요.
<script setup lang="ts">
const value = ref('')
</script>
<template>
<UInput v-model="value" placeholder="" variant="outline" :ui="{ base: 'peer' }">
<label class="pointer-events-none absolute left-0 -top-2.5 text-highlighted text-xs font-medium px-1.5 transition-all peer-focus:-top-2.5 peer-focus:text-highlighted peer-focus:text-xs peer-focus:font-medium peer-placeholder-shown:text-sm peer-placeholder-shown:text-dimmed peer-placeholder-shown:top-1.5 peer-placeholder-shown:font-normal">
<span class="inline-flex bg-default px-1">Email address</span>
</label>
</UInput>
</template>
FormField 안에서 (Within a FormField)
FormField 컴포넌트 안에서 Input을 사용해 라벨, 도움말 텍스트, 필수 표시 등을 함께 표시할 수 있어요.
<script setup lang="ts">
const email = ref('')
</script>
<template>
<UFormField label="Email" help="We won't share your email." required>
<UInput v-model="email" placeholder="Enter your email" icon="i-lucide-at-sign" />
</UFormField>
</template>
[!TIP] See: /docs/components/form
Form 컴포넌트 안에서 사용하면 검증과 오류 처리 기능도 함께 제공돼요.
FieldGroup 안에서 (Within a FieldGroup)
FieldGroup 컴포넌트 안에서 Input을 사용해 여러 요소를 함께 그룹화할 수 있어요.
<script setup lang="ts">
const value = ref('')
const domains = ['.com', '.dev', '.org']
const domain = ref(domains[0])
</script>
<template>
<UFieldGroup>
<UInput
v-model="value"
placeholder="nuxt"
:ui="{
base: 'pl-14.5',
leading: 'pointer-events-none'
}"
>
<template #leading>
<p class="text-sm text-muted">
https://
</p>
</template>
</UInput>
<USelectMenu v-model="domain" :items="domains" />
</UFieldGroup>
</template>
전화번호 입력 (As a phone number input)
FieldGroup 안에서 SelectMenu와 함께 Input을 사용해 국가 코드 선택이 가능한 전화번호 입력을 만들 수 있어요.
<script setup lang="ts">
import { vMaska } from 'maska/vue'
type PhoneCode = {
name: string
code: string
emoji: string
dialCode: string
mask: string
}
const phone = ref('')
const countryCode = ref('US')
const { data: phoneCodes, status, execute } = await useLazyFetch<PhoneCode[]>('/api/phone-codes.json', {
key: 'api-phone-codes',
immediate: false
})
const country = computed(() => phoneCodes.value?.find(c => c.code === countryCode.value))
const dialCode = computed(() => country.value?.dialCode || '+1')
const mask = computed(() => country.value?.mask || '(###) ###-####')
function onOpen() {
if (!phoneCodes.value?.length) {
execute()
}
}
watch(countryCode, () => {
phone.value = ''
})
</script>
<template>
<UFieldGroup>
<USelectMenu
v-model="countryCode"
:items="phoneCodes"
value-key="code"
:search-input="{
placeholder: 'Search country...',
icon: 'i-lucide-search',
loading: status === 'pending'
}"
:filter-fields="['name', 'code', 'dialCode']"
:content="{ align: 'start' }"
:ui="{
base: 'pe-8',
content: 'w-48',
placeholder: 'hidden',
trailingIcon: 'size-4'
}"
trailing-icon="i-lucide-chevrons-up-down"
@update:open="onOpen"
>
<span class="size-5 flex items-center text-lg">
{{ country?.emoji || '\u{1F1FA}\u{1F1F8}' }}
</span>
<template #item-leading="{ item }">
<span class="size-5 flex items-center text-lg">
{{ item.emoji }}
</span>
</template>
<template #item-label="{ item }">
{{ item.name }} ({{ item.dialCode }})
</template>
</USelectMenu>
<UInput
v-model="phone"
v-maska="mask"
:placeholder="mask.replaceAll('#', '_')"
:style="{ '--dial-code-length': `${dialCode.length + 1.5}ch` }"
:ui="{
base: 'ps-(--dial-code-length)',
leading: 'pointer-events-none text-base md:text-sm text-muted'
}"
>
<template #leading>
{{ dialCode }}
</template>
</UInput>
</UFieldGroup>
</template>
API
Props (속성)
/**
* Props for the Input component
*/
interface InputProps {
/**
* The element or component this component should render as.
* @default 'div'
*/
as?: any;
id?: string | undefined;
name?: string | undefined;
/**
* @default 'text'
*/
type?: "number" | "image" | "text" | "button" | "search" | "time" | "color" | "file" | "checkbox" | "date" | "datetime-local" | "email" | "hidden" | "month" | "password" | "radio" | "range" | "reset" | "submit" | "tel" | "url" | "week" | string & {} | undefined;
/**
* The placeholder text when the input is empty.
*/
placeholder?: string | undefined;
/**
* @default 'primary'
*/
color?: "primary" | "secondary" | "success" | "info" | "warning" | "error" | "neutral" | undefined;
/**
* @default 'outline'
*/
variant?: "outline" | "soft" | "subtle" | "ghost" | "none" | undefined;
/**
* @default 'md'
*/
size?: "xs" | "sm" | "md" | "lg" | "xl" | undefined;
required?: boolean | undefined;
/**
* @default 'off'
*/
autocomplete?: string & {} | "on" | "off" | undefined;
autofocus?: boolean | undefined;
/**
* @default 0
*/
autofocusDelay?: number | undefined;
disabled?: boolean | undefined;
/**
* Highlight the ring color like a focus state.
*/
highlight?: boolean | undefined;
/**
* Keep the mobile text size on all breakpoints.
*/
fixed?: boolean | undefined;
modelValue?: _Number<_Optional<_Nullable<T, Mod>, Mod>, Mod> | undefined;
defaultValue?: _Number<_Optional<_Nullable<T, Mod>, Mod>, Mod> | undefined;
modelModifiers?: Mod | undefined;
ui?: { root?: SlotClass; base?: SlotClass; leading?: SlotClass; leadingIcon?: SlotClass; leadingAvatar?: SlotClass; leadingAvatarSize?: SlotClass; trailing?: 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;
enterKeyHint?: "search" | "enter" | "done" | "go" | "next" | "previous" | "send" | undefined;
form?: string | undefined;
formaction?: string | undefined;
formenctype?: string | undefined;
formmethod?: string | undefined;
formnovalidate?: false | true | "true" | "false" | undefined;
formtarget?: string | undefined;
list?: string | undefined;
max?: string | number | undefined;
maxlength?: string | number | undefined;
min?: string | number | undefined;
minlength?: string | number | undefined;
pattern?: string | undefined;
readonly?: false | true | "true" | "false" | undefined;
step?: string | number | undefined;
}
[!NOTE] See: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attributes
이 컴포넌트는 모든 네이티브
<input>HTML 속성도 지원해요.
Slots (슬롯)
/**
* Slots for the Input component
*/
interface InputSlots {
leading(): any;
default(): any;
trailing(): any;
}
Emits (이벤트)
/**
* Emitted events for the Input component
*/
interface InputEmits {
update:modelValue: (payload: [value: _Number<_Optional<_Nullable<T, Mod>, Mod>, Mod>]) => void;
blur: (payload: [event: FocusEvent]) => void;
change: (payload: [event: Event]) => void;
}
Expose (노출)
템플릿 ref로 컴포넌트에 접근할 때 다음을 사용할 수 있어요:
| Name | Type |
|---|---|
inputRef |
Ref<HTMLInputElement | null> |
테마 (Theme)
export default defineAppConfig({
ui: {
input: {
slots: {
root: 'relative inline-flex items-center',
base: [
'w-full rounded-md border-0 appearance-none placeholder:text-dimmed disabled:cursor-not-allowed disabled:opacity-75',
'transition-colors'
],
leading: 'absolute inset-y-0 start-0 flex items-center',
leadingIcon: 'shrink-0 text-dimmed',
leadingAvatar: 'shrink-0',
leadingAvatarSize: '',
trailing: 'absolute inset-y-0 end-0 flex items-center',
trailingIcon: 'shrink-0 text-dimmed'
},
variants: {
fieldGroup: {
horizontal: {
root: 'group has-focus-visible:z-[1]',
base: 'group-not-only:group-first:rounded-e-none group-not-only:group-last:rounded-s-none group-not-last:group-not-first:rounded-none'
},
vertical: {
root: 'group has-focus-visible:z-[1]',
base: 'group-not-only:group-first:rounded-b-none group-not-only:group-last:rounded-t-none group-not-last:group-not-first:rounded-none'
}
},
size: {
xs: {
base: 'px-2 py-1 text-sm/4 gap-1',
leading: 'ps-2',
trailing: 'pe-2',
leadingIcon: 'size-4',
leadingAvatarSize: '3xs',
trailingIcon: 'size-4'
},
sm: {
base: 'px-2.5 py-1.5 text-sm/4 gap-1.5',
leading: 'ps-2.5',
trailing: 'pe-2.5',
leadingIcon: 'size-4',
leadingAvatarSize: '3xs',
trailingIcon: 'size-4'
},
md: {
base: 'px-2.5 py-1.5 text-base/5 gap-1.5',
leading: 'ps-2.5',
trailing: 'pe-2.5',
leadingIcon: 'size-5',
leadingAvatarSize: '2xs',
trailingIcon: 'size-5'
},
lg: {
base: 'px-3 py-2 text-base/5 gap-2',
leading: 'ps-3',
trailing: 'pe-3',
leadingIcon: 'size-5',
leadingAvatarSize: '2xs',
trailingIcon: 'size-5'
},
xl: {
base: 'px-3 py-2 text-base gap-2',
leading: 'ps-3',
trailing: 'pe-3',
leadingIcon: 'size-6',
leadingAvatarSize: 'xs',
trailingIcon: 'size-6'
}
},
variant: {
outline: 'text-highlighted bg-default ring ring-inset ring-accented',
soft: 'text-highlighted bg-elevated/50 hover:bg-elevated focus:bg-elevated disabled:bg-elevated/50',
subtle: 'text-highlighted bg-elevated ring ring-inset ring-accented',
ghost: 'text-highlighted bg-transparent hover:bg-elevated focus:bg-elevated disabled:bg-transparent dark:disabled:bg-transparent',
none: 'text-highlighted bg-transparent focus:outline-none'
},
color: {
primary: '',
secondary: '',
success: '',
info: '',
warning: '',
error: '',
neutral: ''
},
leading: {
true: ''
},
trailing: {
true: ''
},
loading: {
true: ''
},
highlight: {
true: ''
},
fixed: {
false: ''
},
type: {
file: 'file:me-1.5 file:font-medium file:text-muted file:outline-none'
}
},
compoundVariants: [
{
color: 'primary',
variant: [
'outline',
'subtle'
],
class: 'outline-primary/25 focus-visible:outline-3 focus-visible:ring-primary'
},
{
color: 'secondary',
variant: [
'outline',
'subtle'
],
class: 'outline-secondary/25 focus-visible:outline-3 focus-visible:ring-secondary'
},
{
color: 'success',
variant: [
'outline',
'subtle'
],
class: 'outline-success/25 focus-visible:outline-3 focus-visible:ring-success'
},
{
color: 'info',
variant: [
'outline',
'subtle'
],
class: 'outline-info/25 focus-visible:outline-3 focus-visible:ring-info'
},
{
color: 'warning',
variant: [
'outline',
'subtle'
],
class: 'outline-warning/25 focus-visible:outline-3 focus-visible:ring-warning'
},
{
color: 'error',
variant: [
'outline',
'subtle'
],
class: 'outline-error/25 focus-visible:outline-3 focus-visible:ring-error'
},
{
color: 'primary',
variant: [
'soft',
'ghost'
],
class: 'outline-primary/25 focus-visible:outline-3'
},
{
color: 'secondary',
variant: [
'soft',
'ghost'
],
class: 'outline-secondary/25 focus-visible:outline-3'
},
{
color: 'success',
variant: [
'soft',
'ghost'
],
class: 'outline-success/25 focus-visible:outline-3'
},
{
color: 'info',
variant: [
'soft',
'ghost'
],
class: 'outline-info/25 focus-visible:outline-3'
},
{
color: 'warning',
variant: [
'soft',
'ghost'
],
class: 'outline-warning/25 focus-visible:outline-3'
},
{
color: 'error',
variant: [
'soft',
'ghost'
],
class: 'outline-error/25 focus-visible:outline-3'
},
{
color: 'primary',
highlight: true,
class: 'ring ring-inset ring-primary'
},
{
color: 'secondary',
highlight: true,
class: 'ring ring-inset ring-secondary'
},
{
color: 'success',
highlight: true,
class: 'ring ring-inset ring-success'
},
{
color: 'info',
highlight: true,
class: 'ring ring-inset ring-info'
},
{
color: 'warning',
highlight: true,
class: 'ring ring-inset ring-warning'
},
{
color: 'error',
highlight: true,
class: 'ring ring-inset ring-error'
},
{
color: 'neutral',
variant: [
'outline',
'subtle'
],
class: 'outline-inverted/25 focus-visible:outline-3 focus-visible:ring-inverted'
},
{
color: 'neutral',
variant: [
'soft',
'ghost'
],
class: 'outline-inverted/25 focus-visible:outline-3'
},
{
color: 'neutral',
highlight: true,
class: 'ring ring-inset ring-inverted'
},
{
leading: true,
size: 'xs',
class: 'ps-7'
},
{
leading: true,
size: 'sm',
class: 'ps-8'
},
{
leading: true,
size: 'md',
class: 'ps-9'
},
{
leading: true,
size: 'lg',
class: 'ps-10'
},
{
leading: true,
size: 'xl',
class: 'ps-11'
},
{
trailing: true,
size: 'xs',
class: 'pe-7'
},
{
trailing: true,
size: 'sm',
class: 'pe-8'
},
{
trailing: true,
size: 'md',
class: 'pe-9'
},
{
trailing: true,
size: 'lg',
class: 'pe-10'
},
{
trailing: true,
size: 'xl',
class: 'pe-11'
},
{
loading: true,
leading: true,
class: {
leadingIcon: 'animate-spin'
}
},
{
loading: true,
leading: false,
trailing: true,
class: {
trailingIcon: 'animate-spin'
}
},
{
fixed: false,
size: 'xs',
class: 'md:text-xs'
},
{
fixed: false,
size: 'sm',
class: 'md:text-xs'
},
{
fixed: false,
size: 'md',
class: 'md:text-sm'
},
{
fixed: false,
size: 'lg',
class: 'md:text-sm'
}
],
defaultVariants: {
size: 'md',
color: 'primary',
variant: 'outline'
}
}
}
})