Preact : Preact is a JavaScript library that describes itself as a fast 3kB alternative to React with the same ES6 API.
This technology is used by 0.09% of websites in the JavaScript libraries category. The most popular industry vertical is Business and Finance, with Arts and Crafts being the top subcategory.
What is Preact?
Preact is a fast 3KB alternative to React with the same modern API. It provides the thinnest possible Virtual DOM abstraction on top of the DOM, achieving maximum performance while remaining compatible with React's ecosystem through a compatibility layer.
Created by Jason Miller in 2015, Preact was designed to deliver React's component model without the file size overhead. At just 3KB gzipped compared to React's 40KB+, Preact excels in performance-critical scenarios and resource-constrained environments. Companies including Uber, Lyft, and Pepsi use Preact in production, often as a React replacement for better Core Web Vitals scores.
Industry Vertical Distribution
Technologies Frequently Used with Preact
| Technology | Co-usage Rate | Website |
|---|---|---|
| Open Graph | 76.05% | https://ogp.me |
| core-js | 76.01% | https://github.com/zloirock/core-js |
| HSTS | 53.3% | https://www.rfc-editor.org/rfc/rfc6797#section-6.1 |
| webpack | 53.17% | https://webpack.js.org/ |
| Module Federation | 51.93% | https://webpack.js.org/concepts/module-federation/ |
| Facebook Pixel | 44.98% | http://facebook.com |
| HTTP/3 | 43.21% | https://httpwg.org/ |
| 40.19% | http://facebook.com | |
| Google Analytics | 37.01% | http://google.com/analytics |
| Google Tag Manager | 36.92% | http://www.google.com/tagmanager |
Key Features
Size and Performance
- 3KB Size: Minimal bundle impact
- Fast Diff: Efficient Virtual DOM algorithm
- Direct DOM: Closer to the metal
- Memory Efficient: Less runtime overhead
React Compatibility
- preact/compat: React API compatibility layer
- Alias React: Use React libraries directly
- Hooks: Full hooks support
- Context: Context API included
Modern Features
- Signals: Fine-grained reactivity (@preact/signals)
- Fragment: Multiple root elements
- Error Boundaries: Component error handling
- Refs: DOM and component references
Developer Experience
- Preact DevTools extension
- TypeScript support
- Hot Module Replacement
- Create Preact App CLI
AI-Powered Technology Recommendations
Our AI recommender engine, trained on 100 million data points, suggests these technologies for websites using Preact:
| Technology | AI Score | Website |
|---|---|---|
| Podium | 0.36 | https://www.podium.com |
| Yotpo SMSBump | 0.33 | https://www.yotpo.com/platform/smsbump-sms-marketing/ |
| Sucuri | 0.18 | https://sucuri.net/ |
| Segment Consent Manager | 0.16 | https://segment.com/blog/how-to-build-consent-management-into-your-site-in-less-than-a-week |
| Klaro | 0.16 | https://heyklaro.com |
| Microsoft Word | 0.15 | https://office.microsoft.com/word |
| AngularJS | 0.14 | https://angularjs.org |
| Lucky Orange | 0.14 | https://www.luckyorange.com |
| Marchex | 0.13 | https://www.marchex.com |
| Bluehost | 0.13 | https://www.bluehost.com |
IAB Tier 1 Vertical Distribution
Relative Usage by Industry
Market Distribution Comparison
Use Cases
Embedded Widgets
Third-party widgets embedded on customer sites use Preact for minimal footprint. The small bundle size means widgets don't significantly impact host page performance.
Mobile Web Performance
Mobile-first websites replace React with Preact for faster loading on constrained networks. The reduced JavaScript size improves Time to Interactive metrics.
Progressive Web Apps
PWAs targeting low-end devices and emerging markets use Preact. The performance characteristics suit environments where every kilobyte matters.
React Project Migration
Existing React projects migrate to Preact for performance gains. The compatibility layer allows gradual migration while maintaining existing component libraries.
Advertising and Marketing
Ad tech and marketing platforms use Preact for interactive ad units. Size constraints for ad delivery make Preact's footprint essential.
IoT Dashboards
Interfaces running on embedded browsers and IoT devices choose Preact. Limited memory and processing power suit Preact's efficiency.
IAB Tier 2 Subcategory Distribution
Top Websites Using Preact
| Website | IAB Category | Subcategory | OpenRank |
|---|---|---|---|
| apple.com | Technology & Computing | Computing | 7.49 |
| bing.com | Business and Finance | Search Engine/Listings | 7.13 |
| alibaba.com | Business and Finance | Industries | 6.15 |
| goodhousekeeping.com | Home & Garden | Beauty | 5.49 |
| webflow.com | Fine Art | Design | 5.42 |
| turbosquid.com | Hobbies & Interests | Model Toys | 5.33 |
| timeshighereducation.com | Education | Industries | 5.32 |
| orange.com | Hobbies & Interests | Computing | 5.26 |
| talkingpointsmemo.com | News and Politics | Politics | 5.11 |
| hola.com | Pop Culture | Street Style | 4.95 |
Code Examples
Basic Component
import { h, render } from 'preact';
import { useState } from 'preact/hooks';
function Counter() {
const [count, setCount] = useState(0);
return (
<button onClick={() => setCount(c => c + 1)}>
Count: {count}
</button>
);
}
render(<Counter />, document.getElementById('app'));
With Signals
import { signal, computed } from '@preact/signals';
const count = signal(0);
const double = computed(() => count.value * 2);
function Counter() {
return (
<div>
<p>Count: {count}</p>
<p>Double: {double}</p>
<button onClick={() => count.value++}>Increment</button>
</div>
);
}
React Compatibility
// vite.config.js or webpack alias
{
resolve: {
alias: {
'react': 'preact/compat',
'react-dom': 'preact/compat',
'react-dom/test-utils': 'preact/test-utils',
'react/jsx-runtime': 'preact/jsx-runtime'
}
}
}
// Now React libraries work with Preact
import { useState } from 'react'; // Actually imports from Preact
Custom Hook
import { useState, useEffect } from 'preact/hooks';
function useFetch(url) {
const [data, setData] = useState(null);
const [loading, setLoading] = useState(true);
useEffect(() => {
fetch(url)
.then(r => r.json())
.then(data => {
setData(data);
setLoading(false);
});
}, [url]);
return { data, loading };
}
Usage by Domain Popularity (Top 1M)
Usage by Domain Age
The average age of websites using Preact is 12.2 years. The average OpenRank (measure of backlink strength) is 2.77.
Comparison and Ecosystem
Preact vs React
- Size: Preact 3KB, React 40KB+
- Performance: Preact faster in benchmarks
- API: Nearly identical with compat layer
- Ecosystem: React larger, Preact compatible
- Synthetic Events: React yes, Preact no
Differences from React
- No synthetic event system
- class instead of className works
- Props spread directly to DOM
- Some lifecycle differences
Ecosystem
- Preact CLI: Project scaffolding
- @preact/signals: Fine-grained reactivity
- preact-router: Simple routing
- wmr: Development tool
When to Choose Preact
- Bundle size critical
- Performance-sensitive applications
- Embedded widgets
- React compatibility needed
When to Use React Instead
- Complex synthetic event needs
- Maximum ecosystem compatibility
- Team expertise in React
- React Native targets
Emerging Websites Using Preact
| Website | IAB Category | Subcategory | OpenRank |
|---|---|---|---|
| pharmalogika.com | Business and Finance | Industries | 0 |
| mckinneyjewelryandloan.com | Hobbies & Interests | Personal Debt | 0 |
| wear21159.com | Business and Finance | Men's Fashion | 0 |
| cms-web.org | Business and Finance | Search Engine/Listings | 0 |
| soundpointmesa.com | Healthy Living | Arts and Crafts | 0 |
Technologies Less Frequently Used with Preact
| Technology | Co-usage Rate | Website |
|---|---|---|
| Parse.ly | 0.04% | https://www.parse.ly |
| basket.js | 0.04% | https://addyosmani.github.io/basket.js/ |
| Fera Product Reviews App | 0.04% | https://apps.shopify.com/fera |
| Apollo | 0.04% | https://www.apollographql.com |
| Mantine | 0.04% | https://mantine.dev |
