Blueprint.js Counter Example - Blueprint-js Typing CST Test
Loading…
Blueprint.js Counter Example — Blueprint-js Code
Demonstrates a simple counter layout using Blueprint.js components and React for interactivity.
import React, { useState } from 'react';
import { Button, Card, Elevation, H2 } from '@blueprintjs/core';
import '@blueprintjs/core/lib/css/blueprint.css';
const Counter = () => {
const [count, setCount] = useState(0);
const [isDark, setIsDark] = useState(false);
return (
<div className={isDark ? 'bp3-dark' : ''} style={{ display: 'flex', justifyContent: 'center', marginTop: '50px' }}>
<Card elevation={Elevation.TWO} style={{ padding: '20px', textAlign: 'center' }}>
<H2>Counter: {count}</H2>
<Button intent='primary' onClick={() => setCount(count + 1)} style={{ margin: '5px' }}>+</Button>
<Button intent='danger' onClick={() => setCount(count - 1)} style={{ margin: '5px' }}>-</Button>
<Button onClick={() => setCount(0)} style={{ margin: '5px' }}>Reset</Button>
<br /><br />
<Button intent='warning' onClick={() => setIsDark(!isDark)}>Switch Theme</Button>
</Card>
</div>
);
};
export default Counter;Blueprint-js Language Guide
BlueprintJS is a React-based UI toolkit for building complex, data-dense, desktop-focused web applications. It emphasizes performance, usability, and a consistent design language for enterprise applications.
Primary Use Cases
- ▸Data-heavy dashboards and analytics platforms
- ▸Admin panels for enterprise software
- ▸Trading or financial web apps
- ▸Complex forms and data tables
- ▸React-based desktop-focused applications
Notable Features
- ▸Comprehensive React component library
- ▸Optimized for desktop and data-dense layouts
- ▸Keyboard and accessibility support
- ▸Theming support with CSS variables
- ▸High performance for large datasets
Origin & Creator
Created by Palantir in 2015, BlueprintJS was designed to address the needs of data-intensive web applications, offering a consistent, professional UI toolkit for desktop-focused web apps.
Industrial Note
Perfect for enterprise apps, analytics dashboards, trading platforms, and tools that require dense data presentation, keyboard navigation, and advanced interactions.