Beautiful animated button component for Svelte with slide and arc animations
Easy to use, customizable button component with smooth hover animations - inspired by shadcn/ui style
npm install @chulkovdanila/svelte-uikit
npm install github:ChulkovDanila/svelte-ui-kit
After installation, import components directly:
<script>
import { HorizontalSlideButton, VerticalSlideButton } from '@chulkovdanila/svelte-uikit';
</script>
<HorizontalSlideButton>Click me</HorizontalSlideButton>
<VerticalSlideButton>Hover me</VerticalSlideButton>
For full control over component code, copy components directly into your project:
npm install @chulkovdanila/svelte-uikit
mkdir -p src/lib/components/ui
cp -r node_modules/@chulkovdanila/svelte-uikit/src/lib/components/HorizontalSlideButton src/lib/components/ui/
cp -r node_modules/@chulkovdanila/svelte-uikit/src/lib/components/VerticalSlideButton src/lib/components/ui/
mkdir -p src/lib/utils
cp node_modules/@chulkovdanila/svelte-uikit/src/lib/utils/cn.ts src/lib/utils/
mkdir -p src/lib/types
cp node_modules/@chulkovdanila/svelte-uikit/src/lib/types/index.ts src/lib/types/
<script>
import { HorizontalSlideButton } from '$lib/components/ui/HorizontalSlideButton';
import { VerticalSlideButton } from '$lib/components/ui/VerticalSlideButton';
</script>
<HorizontalSlideButton>Click me</HorizontalSlideButton>
<VerticalSlideButton>Hover me</VerticalSlideButton>
<script>
import { HorizontalSlideButton, VerticalSlideButton } from '@chulkovdanila/svelte-uikit';
</script>
<HorizontalSlideButton>Click me</HorizontalSlideButton>
<VerticalSlideButton>Hover me</VerticalSlideButton>
VerticalSlideButton is a clean, text-only button with vertical letter animation on hover:
<VerticalSlideButton
color="#000000"
hoverColor="#666666"
fontSize="2rem"
animationSpeed="medium"
>
Click me
</VerticalSlideButton>
<!-- Slide Animation (horizontal) -->
<HorizontalSlideButton animationType="slide">Get Started</HorizontalSlideButton>
<!-- Arc Animation (curved) -->
<HorizontalSlideButton animationType="arc">Discover</HorizontalSlideButton>
<HorizontalSlideButton animationSpeed="fast">Fast</HorizontalSlideButton>
<HorizontalSlideButton animationSpeed="medium">Medium</HorizontalSlideButton>
<HorizontalSlideButton animationSpeed="slow">Slow</HorizontalSlideButton>
<HorizontalSlideButton variant="default">Default</HorizontalSlideButton>
<HorizontalSlideButton variant="default-rounded">Default Rounded</HorizontalSlideButton>
<HorizontalSlideButton variant="outline">Outline</HorizontalSlideButton>
<HorizontalSlideButton variant="outline-rounded">Outline Rounded</HorizontalSlideButton>
<HorizontalSlideButton variant="destructive">Delete</HorizontalSlideButton>
<HorizontalSlideButton variant="destructive-rounded">Delete Rounded</HorizontalSlideButton>
<HorizontalSlideButton variant="ghost">Cancel</HorizontalSlideButton>
<HorizontalSlideButton variant="ghost-rounded">Cancel Rounded</HorizontalSlideButton>
<HorizontalSlideButton variant="default-rounded">Rounded Button</HorizontalSlideButton>
<HorizontalSlideButton variant="outline-rounded">Outline Rounded</HorizontalSlideButton>
<HorizontalSlideButton variant="destructive-rounded">Destructive Rounded</HorizontalSlideButton>
<HorizontalSlideButton
animationType="slide"
animationSpeed="medium"
variant="outline-rounded"
>
Learn More
</HorizontalSlideButton>
<VerticalSlideButton
color="#ff0000"
hoverColor="#cc0000"
fontSize="1.5rem"
animationSpeed="slow"
>
Hover Me
</VerticalSlideButton>
| Prop | Type | Default | Description |
|---|---|---|---|
animationType |
'slide' | 'arc' |
'slide' |
Animation type: slide (horizontal) or arc (curved) |
animationSpeed |
'fast' | 'medium' | 'slow' |
'fast' |
Animation speed: fast (1s), medium (2s), or slow (3s) |
variant |
'default' | 'default-rounded' | 'outline' | 'outline-rounded' | 'destructive' | 'destructive-rounded' | 'ghost' | 'ghost-rounded' |
'default' |
Button style variant with optional rounded corners |
disabled |
boolean |
false |
Disable button interactions |
type |
'button' | 'submit' | 'reset' |
'button' |
HTML button type |
class |
string |
'' |
Additional CSS classes |
| Prop | Type | Default | Description |
|---|---|---|---|
animationSpeed |
'fast' | 'medium' | 'slow' |
'fast' |
Animation speed: fast (1s), medium (2s), or slow (3s) |
color |
string |
'#000000' |
Text color |
hoverColor |
string |
'#666666' |
Text color on hover |
disabledColor |
string |
'#999999' |
Text color when disabled |
fontSize |
string |
'2rem' |
Font size |
fontWeight |
number | string |
700 |
Font weight |
disabled |
boolean |
false |
Disable button interactions |
type |
'button' | 'submit' | 'reset' |
'button' |
HTML button type |
class |
string |
'' |
Additional CSS classes |
Horizontal text movement - text slides right on hover, new text slides in from left.
GitHub Search Keywords: slide animation button, horizontal animation button
Curved movement with rotation - text moves in a semicircle path with rotation effect.
GitHub Search Keywords: arc animation button, curved animation button
import type { ButtonVariant, ButtonAnimationType } from '@chulkovdanila/svelte-uikit';
const variant: ButtonVariant = 'outline';
const animationType: ButtonAnimationType = 'slide';
Available types are exported from HorizontalSlideButton/types.
You can customize button colors by modifying CSS or using custom classes:
<HorizontalSlideButton class="custom-button">Custom</HorizontalSlideButton>
<style>
:global(.custom-button) {
background-color: #your-color;
color: #your-text-color;
}
:global(.custom-button:hover) {
background-color: #your-hover-color;
}
</style>
For VerticalSlideButton, use props:
<VerticalSlideButton
color="#your-color"
hoverColor="#your-hover-color"
disabledColor="#your-disabled-color"
>
Custom Colors
</VerticalSlideButton>
Watch our animated button components in action!
See the SHOWCASE.md document for complete information.
Clone the repository:
git clone https://github.com/ChulkovDanila/svelte-ui-kit.git
cd svelte-ui-kit
npm install
Run development server:
npm run dev
MIT License - feel free to use in your projects!
Contributions are welcome! Please feel free to submit a Pull Request.
See CONTRIBUTING.md for guidelines.
Search on GitHub using these keywords:
slide animation button sveltearc animation button sveltecurved animation button sveltehorizontal animation button svelteanimated button sveltesvelte ui kitMade with ❤️ for the Svelte community