Installation

Add FancyUI to a SvelteKit project in three steps: install the package, import the stylesheet, render a component.

Svelte 5 Tailwind CSS 4 Node.js 20.19+ TypeScript

Prerequisites

FancyUI targets the current Svelte toolchain. Check these three before installing.

SvelteKit Svelte 5

Components are written with runes, so Svelte 5 is required. Svelte 4 projects will not compile them.

Tailwind CSS v4

Styling relies on Tailwind v4 utilities and CSS custom properties.

Node.js 20.19+

Required by the SvelteKit and Vite versions FancyUI builds against.

Install

Pick your package manager, wire up the stylesheet, then render your first component.

  1. Install the package

    One package for every component. Switch tabs to copy the command for your package manager.

    pnpm add fancy-ui-svelte
  2. Import the stylesheet

    Add the FancyUI stylesheet right after your Tailwind import.

    css
    @import "tailwindcss";
    @import "fancy-ui-svelte/tailwind.css";

    In your global stylesheet, usually src/app.css.

  3. Render a component

    Import from the package root and drop it into your markup.

    svelte
    <script lang="ts">
    	import { RainbowButton } from 'fancy-ui-svelte';
    </script>
    
    <RainbowButton>Click me</RainbowButton>

Tailwind CSS setup

FancyUI is built on Tailwind CSS v4, which is configured in CSS instead of a JavaScript config file. If Tailwind already works in your project, there is nothing else to configure.

Import order matters: Tailwind first, FancyUI second, so FancyUI's layers and custom properties resolve on top of the defaults.

The stylesheet carries the design tokens every component reads: colors, radii and animation timings. Without it, components render unstyled.

Usage

Every component is a named export of the package root, so there are no per-component import paths to remember.

svelte
<script lang="ts">
	import { BorderBeam, RainbowButton } from 'fancy-ui-svelte';
</script>

<div class="relative overflow-hidden rounded-xl border p-8">
	<RainbowButton>Click me</RainbowButton>
	<BorderBeam colorFrom="#9E7AFF" colorTo="#FE8BBB" />
</div>

Each component's page lists its props, live examples and accessibility notes.

TypeScript

Prop types are exported next to each component, so you can type wrappers and shared presets.

ts
import { type BorderBeamProps } from 'fancy-ui-svelte';

const beam: BorderBeamProps = { colorFrom: "#9E7AFF", colorTo: "#FE8BBB" };

Types ship inside the package. There is no separate types package to install.

Peer dependencies

FancyUI expects these to already exist in your project:

PackageVersion
svelte^5.0.0
tailwindcss^4.0.0

A few components need extra runtime libraries. These ship with the package, so there is nothing more to install:

@chenglou/pretextcanvas-confetticlsxgsaptailwind-mergethree

They are only pulled in by the components that use them.

Next steps