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
- π¨ Two Animation Types: Slide (horizontal) and Arc (curved) animations
- β‘ Three Speed Options: Fast, Medium, and Slow animations
- π― Multiple Variants: Default, Outline, Destructive, and Ghost styles
- π¦ Easy Installation: Copy components directly into your project (like shadcn/ui)
- π§ Fully Customizable: Modify colors, sizes, and animations to fit your design
- πͺ TypeScript Support: Full type safety out of the box
- π No Dependencies: Pure Svelte component, no external dependencies
npm install @chulkovdanila/svelte-uikitnpm install github:ChulkovDanila/svelte-ui-kitAfter installation, import components directly:
<script>
import { Button } from '@chulkovdanila/svelte-uikit';
</script>
<Button>Click me</Button>For full control over component code, copy components directly into your project:
- Install the package:
npm install @chulkovdanila/svelte-uikit- Copy Button component:
mkdir -p src/lib/components/ui
cp -r node_modules/@chulkovdanila/svelte-uikit/src/lib/components/Button src/lib/components/ui/- Copy utilities:
mkdir -p src/lib/utils
cp node_modules/@chulkovdanila/svelte-uikit/src/lib/utils/cn.ts src/lib/utils/- Copy types (TypeScript):
mkdir -p src/lib/types
cp node_modules/@chulkovdanila/svelte-uikit/src/lib/types/index.ts src/lib/types/- Import from local:
<script>
import { Button } from '$lib/components/ui/Button';
</script>
<Button>Click me</Button><script>
import { Button } from '@chulkovdanila/svelte-uikit';
</script>
<Button>Click me</Button><!-- Slide Animation (horizontal) -->
<Button animationType="slide">Get Started</Button>
<!-- Arc Animation (curved) -->
<Button animationType="arc">Discover</Button><Button animationSpeed="fast">Fast</Button>
<Button animationSpeed="medium">Medium</Button>
<Button animationSpeed="slow">Slow</Button><Button variant="default">Default</Button>
<Button variant="outline">Outline</Button>
<Button variant="destructive">Delete</Button>
<Button variant="ghost">Cancel</Button><Button rounded>Rounded Button</Button><Button
animationType="slide"
animationSpeed="medium"
variant="outline"
rounded
>
Learn More
</Button>| Prop | Type | Default | Description |
|---|---|---|---|
animationType |
'slide' | 'arc' |
'slide' |
Animation type: slide (horizontal) or arc (curved) |
animationSpeed |
'fast' | 'medium' | 'slow' |
'fast' |
Animation speed: fast (0.4s), medium (0.7s), or slow (1.2s) |
variant |
'default' | 'outline' | 'destructive' | 'ghost' |
'default' |
Button style variant |
rounded |
boolean |
false |
Fully rounded button corners |
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';You can customize button colors by modifying CSS or using custom classes:
<Button class="custom-button">Custom</Button>
<style>
:global(.custom-button) {
background-color: #your-color;
color: #your-text-color;
}
:global(.custom-button:hover) {
background-color: #your-hover-color;
}
</style>Watch our animated button components in action!
- π¬ Slide Animation Showcase - Smooth horizontal text movement
- π¬ Arc Animation Showcase - Beautiful curved movement with rotation
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 installRun development server:
npm run devMIT 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 kit
Made with β€οΈ for the Svelte community