This repository serves as a reference for building a reusable button component in Vue and TailwindCSS.
Documentation
Documentation
Untitled2.mp4
- Variants: Solid, Soft, Outline, Ghost
- Colors: Primary, Neutral, Danger, Success, Warning, Light, Dark
- Sizes: 20, 24, 28, 32, 36, 40, 44
- Types: Button, Submit, Link (internal/external)
- Icons: Supports icon and icon-only buttons
- States: Loading, Disabled, Active (e.g. when a dropdown is open)
<UIButton size="20" color="primary" variant="outline">
<template #icon>
<RiEditLine class="tw-w-full tw-h-full" />
</template>
Edit
</UIButton>
<UIIconButton size="20" color="primary" variant="outline">
<RiEditLine class="tw-w-full tw-h-full" />
</UIButton>
- size: Specifies the height, with the width adjusting proportionally
- Options:
20
|24
|28
|32
|36
|40
|44
- Options:
- type: Defines the button type
- Options:
button
|submit
|link
- Note:
link
turns the button into an anchor element
- Options:
- to: URL for the link type
- variant: Button style variant
- Options:
solid
|soft
|outline
|ghost
- Options:
- color: Button color
- Options:
primary
|neutral
|danger
|success
|warning
|light
|dark
- Options:
- active: Boolean indicating an active state, useful for dropdowns
- Style is similar to hover state, midway between default and fully active
- disable: Disables the button
- loading: Displays a loading spinner