stoked-ds
v0.4.0
Published
A lightweight, accessible React design system with zero-runtime CSS
Downloads
710
Maintainers
Readme
stoked-ds
A lightweight, accessible React design system with zero-runtime CSS.
Features
- 27 Components - Full set of form controls, feedback, data display, layout, and navigation components
- Zero-runtime CSS - CSS Modules with CSS Variables, no JavaScript runtime overhead
- Accessible - WAI-ARIA compliant with keyboard navigation support
- Dark Mode - Built-in dark theme via
data-themeattribute - TypeScript - Full type definitions included
- Tree-shakeable - Import only what you need
Installation
npm install stoked-dsQuick Start
import { Button, Input, Sidebar, AppShell } from 'stoked-ds';
import 'stoked-ds/dist/index.css';
function App() {
return (
<div data-theme="dark">
<Input placeholder="Enter your name" />
<Button variant="solid" color="primary">
Submit
</Button>
</div>
);
}Components
Form Controls
Button- Primary actions with solid, outline, ghost, and link variantsInput- Text input with label, helper text, and error statesSearchInput- Input with built-in search icon and Enter-to-searchSelect- Dropdown selectionCheckbox- Single or multiple selectionRadio/RadioGroup- Single selection from optionsSwitch- Toggle on/offButtonGroup- Toggle group for mutually exclusive options
Feedback
Alert- Informational messages with success, warning, error, info variantsModal- Dialog overlaysToast/ToastProvider- Temporary notificationsSpinner- Loading indicatorProgress- Progress bar with animated and indeterminate statesSkeleton- Content placeholder with pulse and wave animationsTooltip- Contextual information on hover
Data Display
Badge- Status indicators and labelsTag- Removable labels with color variants (solid/outline)Avatar- User images with fallbackCard- Content containersStatCard- Metric card with icon, value, trend, and statusAccordion- Collapsible content sectionsTabs- Tabbed navigationTable- Data tables
Layout
Sidebar- Collapsible sidebar navigation with sections and itemsAppShell- Application layout wrapper (sidebar + header + content)
Navigation
Breadcrumb- Hierarchical navigation trailPagination- Page navigation with smart ellipsis
Integrations
stoked-ds provides optional adapters for popular third-party libraries. Import them from separate sub-paths — they won't affect your bundle if you don't use them.
React Hook Form
npm install react-hook-formimport { useForm } from 'react-hook-form';
import { Form, FormField } from 'stoked-ds/integrations/react-hook-form';
import { Input, Button } from 'stoked-ds';
function LoginForm() {
const form = useForm({ defaultValues: { email: '', password: '' } });
return (
<Form form={form} onSubmit={(data) => console.log(data)}>
<FormField
control={form.control}
name="email"
render={({ field, error }) => (
<Input {...field} label="Email" error={error?.message} />
)}
/>
<Button type="submit">Sign In</Button>
</Form>
);
}TanStack Table
npm install @tanstack/react-tableimport { DataTable } from 'stoked-ds/integrations/tanstack-table';
import type { ColumnDef } from 'stoked-ds/integrations/tanstack-table';
const columns: ColumnDef<User>[] = [
{ accessorKey: 'name', header: 'Name' },
{ accessorKey: 'email', header: 'Email' },
];
function UsersTable({ users }: { users: User[] }) {
return (
<DataTable
columns={columns}
data={users}
enableSorting
enablePagination
pageSize={10}
variant="striped"
/>
);
}react-day-picker
npm install react-day-pickerimport { DatePicker, DateRangePicker } from 'stoked-ds/integrations/react-day-picker';
function BookingForm() {
const [date, setDate] = useState<Date>();
return (
<DatePicker
label="Check-in date"
value={date}
onValueChange={setDate}
minDate={new Date()}
size="md"
/>
);
}react-select
npm install react-selectimport { AdvancedSelect } from 'stoked-ds/integrations/react-select';
const options = [
{ label: 'React', value: 'react' },
{ label: 'Vue', value: 'vue' },
{ label: 'Svelte', value: 'svelte' },
];
function TechPicker() {
return (
<AdvancedSelect
label="Technologies"
options={options}
isMulti
isSearchable
isClearable
size="md"
/>
);
}Recharts
npm install rechartsimport { ChartCard, StokedLineChart } from 'stoked-ds/integrations/recharts';
const data = [
{ month: 'Jan', revenue: 4000, profit: 2400 },
{ month: 'Feb', revenue: 3000, profit: 1398 },
{ month: 'Mar', revenue: 5000, profit: 3800 },
];
function Dashboard() {
return (
<ChartCard title="Monthly Revenue">
<StokedLineChart
data={data}
dataKeys={['revenue', 'profit']}
xAxisKey="month"
showLegend
/>
</ChartCard>
);
}Coming Soon
- React Flow — Styled nodes and controls for node-based UIs
Storybook
Run npm run dev to launch Storybook with:
- All 27 component stories with controls and docs
- 8 Page stories — Full-screen inventory management pages showing how components compose into real UIs (Dashboard, Inventory List, Inventory Detail, Warehouses, Stock Entry, Reports, Settings, Loading States)
- 5 Integration demos (React Hook Form, TanStack Table, react-day-picker, react-select, Recharts)
Theming
Enable dark mode by adding data-theme="dark" to a parent element:
<div data-theme="dark">
{/* Components will use dark theme */}
</div>Light mode:
<div data-theme="light">
{/* Components will use light theme */}
</div>CSS Tokens
Import design tokens for custom styling:
@import 'stoked-ds/dist/tokens/index.css';Available tokens:
- Colors:
--stoked-color-* - Spacing:
--stoked-spacing-* - Typography:
--stoked-text-*,--stoked-font-* - Borders:
--stoked-radius-* - Shadows:
--stoked-shadow-* - Transitions:
--stoked-duration-*,--stoked-easing-*
Requirements
- React >= 18.0.0
- React DOM >= 18.0.0
License
MIT © Pablo Cabrol
