Welcome to Svelte Pure Admin
@keenmate/svelte-pure-admin is a Svelte 5 component library that wraps the Pure Admin CSS framework
(@keenmate/pure-admin-core) into type-safe, reactive Svelte components.
Built using modern Svelte 5 features (runes, snippets), this library provides ready-to-use components that follow the HTML patterns defined in the core framework's snippet library.
Svelte 5
Built with runes API
Components
Ready to use
Themes
Fully customizable
About This Demo
This documentation site showcases the svelte-pure-admin component library with multiple theme options. Use the settings panel (gear icon) to switch between themes and customize the appearance.
On initial page load, you may notice a brief flash of the Audi theme before your selected theme loads. This is expected behavior in this demo.
Why? The Audi theme is bundled statically to prevent unstyled content (FOUC), then your saved theme preference loads dynamically via JavaScript.
In a production application, you would import only one theme statically:
import '@keenmate/pure-admin-theme-corporate';
This eliminates the flash entirely since there's no theme switching overhead.
About SettingsPanel
The SettingsPanel component (gear icon in the corner) is primarily a demo and development tool to showcase what's possible with pure-admin-core. It's not typically something you'd expose to end users in production.
In a real application, these settings would be handled differently:
- App-level constants (hardcoded): theme, layout width, sidebar behavior - decided during development
- User preferences (stored per-user): font size, compact mode - saved to user profile/database
- Design decisions (not configurable): avatar visibility, icon-only tabs - part of your app's design
The SettingsPanel demonstrates runtime customization, but most apps would make these choices at build time or store them server-side.
If you do need runtime settings that affect Svelte components (like ProfilePanel), use the onsettingschange prop to pass settings as reactive props:
<script>
let profileHasAvatar = $state(true);
let profileIconOnlyTabs = $state(false);
function handleSettingsChange(settings) {
profileHasAvatar = settings.profileHasAvatar;
profileIconOnlyTabs = settings.profileIconOnlyTabs;
}
</script>
<SettingsPanel onsettingschange={handleSettingsChange} />
<ProfilePanel
hasAvatar={profileHasAvatar}
hasIconOnlyTabs={profileIconOnlyTabs}
...
/> This ensures Svelte's reactivity system updates the components correctly, rather than relying on DOM manipulation which can be lost on re-render.
Installation
Install the library and your preferred theme:
npm install @keenmate/svelte-pure-admin @keenmate/pure-admin-theme-audi
Or with your package manager of choice:
# pnpm pnpm add @keenmate/svelte-pure-admin @keenmate/pure-admin-theme-audi
# yarn yarn add @keenmate/svelte-pure-admin @keenmate/pure-admin-theme-audi
Basic Setup
After installation, import your chosen theme CSS and wrap your app in the PureAdminProvider component.
1. Import the theme (in your root layout)
<script> // Import your chosen theme - pick ONE import '@keenmate/pure-admin-theme-audi'; // or: import '@keenmate/pure-admin-theme-corporate'; // or: import '@keenmate/pure-admin-theme-dark'; // etc. </script>
2. Wrap your app with PureAdminProvider
<script>
import { PureAdminProvider, Layout, Navbar, Sidebar, Main } from '@keenmate/svelte-pure-admin';
import '@keenmate/pure-admin-theme-corporate';
let { children } = $props();
</script>
<PureAdminProvider>
<Navbar>
<!-- Your navbar content -->
</Navbar>
<Layout>
<Sidebar>
<!-- Your sidebar content -->
</Sidebar>
<Main>
{@render children()}
</Main>
</Layout>
</PureAdminProvider> 3. Use components anywhere in your app
<script>
import { Button, Card, Alert, Input } from '@keenmate/svelte-pure-admin';
</script>
<Card titleText="My Card">
<Alert variant="info">Welcome to Pure Admin!</Alert>
<Input placeholder="Enter your name" />
<Button variant="primary">Submit</Button>
</Card>What is PureAdminProvider?
PureAdminProvider is a context provider that wraps your application and provides two main features:
1. Application Configuration
Provides a shared configuration context accessible to all child components via usePureAdminConfig().
This includes app metadata, default values, UI preferences, and feature flags.
interface PureAdminConfig {
app: {
name: string;
copyright: string;
version?: string;
logo?: string;
};
defaults: {
pageSize: number;
connectionTimeout: number;
requestTimeout: number;
dateFormat: string;
timeFormat: string;
locale: string;
};
ui: {
theme: 'light' | 'dark';
animations: boolean;
sidebarCollapsed: boolean;
compact: boolean;
};
features?: { [key: string]: boolean };
}2. Global Keyboard Shortcuts
Manages a global keyboard shortcut system. Components can register shortcuts, and the provider handles the keydown events. Press Shift + ? to see all available shortcuts.
Usage Example
<script>
import { PureAdminProvider } from '@keenmate/svelte-pure-admin';
const config = {
app: {
name: 'My Application',
copyright: '© 2025 My Company'
},
defaults: {
pageSize: 50,
locale: 'cs-CZ'
}
};
</script>
<PureAdminProvider {config}>
<!-- Your app content -->
</PureAdminProvider>Available Themes
Pure Admin comes with 5 example themes that serve as starter packs for your own customization. Each theme demonstrates different color schemes and provides a foundation you can build upon.
Audi
Clean design with sharp contrasts. A good starting point for modern admin interfaces.
Corporate
Traditional look with conservative colors. Starter for business-oriented applications.
Dark
Dark mode example. Use as a base for building your own dark theme variant.
Express
Bolder accent colors. Example of a more vibrant color palette.
Minimal
Subtle colors with reduced visual noise. Starting point for minimalist designs.
Component Overview
The library includes 40+ components organized into logical categories:
Layout
- Layout, LayoutInner, LayoutContent
- Navbar, NavItem, NavDropdown
- Sidebar, SidebarItem
- Main, Footer
Forms
- Input, Select, Textarea
- Checkbox, Radio
- FormGroup, FormLabel
- InputGroup, InputGroupAddon
Feedback
- Alert, Callout
- Toast, ToastContainer
- Modal, DialogContainer
- Spinner, Loaders
Data Display
- Table, TableResponsive
- Card
- Badge, BadgeGroup
- Code, CodeBlock
Navigation
- Tabs
- CommandPalette
- ProfilePanel
- SettingsPanel
Interactive
- Button, ButtonGroup
- Tooltip, Popover
- Popconfirm
- Lists, Checkbox Lists
Explore the sidebar navigation to see detailed examples and documentation for each component.
Next Steps
Browse the Components Overview to see all available components with live examples.
Check Theme Variables to learn how to customize colors and styles.