Performance
Slate is designed for performance.
Bundle Size
Slate has minimal impact on bundle size:
- Zero JavaScript by default
- CSS-only components where possible
- Alpine.js only for interactive components
- No dependencies beyond Tailwind CSS
Optimization Tips
1. Purge Unused CSS
Tailwind CSS automatically purges unused styles in production.
2. Use CSS Variables
Slate uses CSS variables for theming, which are efficient:
styles.css
:root {
--color-primary: 250 84% 47%;
}
3. Lazy Load Components
For large pages, consider lazy loading:
example.blade.php
@@once
@@push('styles')
<link rel="stylesheet" href="...">
@@endpush
@@endonce
4. Minimize Alpine.js
Only use Alpine.js where needed. Most components work without it.
Best Practices
- Use production builds - Minified CSS/JS
- Purge CSS - Remove unused styles
- Optimize images - If using images in components
- Test performance - Use Lighthouse or similar
Metrics
Typical performance impact:
- CSS size: ~50KB (gzipped)
- JavaScript: 0KB (unless using Alpine.js)
- Load time: Minimal impact