Welcome to WorksBuddy
A modern, accessible, and customizable React component library built with TypeScript and CSS variables for maximum flexibility.
What is WorksBuddy?
WorksBuddy is a production-ready component library designed to accelerate your development process. It provides a collection of carefully crafted, accessible UI components with a consistent design system, comprehensive documentation, and real-world usage examples.
Key Features
- Built with React 18+: Modern React patterns with TypeScript support
- CSS Variables: Fully customizable theming system using CSS custom properties
- Accessible: WCAG 2.1 AA compliant components with keyboard navigation
- Production Ready: Battle-tested components used in real applications
- Multiple Variants: Each component supports multiple visual styles (fill, stroke, text)
- Responsive: Mobile-first design with responsive sizing
- Well Documented: Clear examples and comprehensive API documentation
- Zero Dependencies: Only depends on React, no additional libraries
Installation
Get WorksBuddy installed in your project with a single command.
Using npm
npm install works-buddy
Using yarn
yarn add works-buddy
Using pnpm
pnpm add works-buddy
Import Styles
WorksBuddy includes global styles and CSS variables. Import them in your application's entry point:
// In your main.jsx or index.js
import 'works-buddy/style';
TypeScript Support
WorksBuddy includes full TypeScript support out of the box. All components are fully typed, and type definitions are included with the package.
Browser Support
- Chrome (latest)
- Firefox (latest)
- Safari (latest)
- Edge (latest)
Quick Start
Get your first component up and running in minutes.
1. Import a Component
import { WbButton, ArrowRightIcon } from 'works-buddy';
2. Use the Component
<WbButton
variant="fill"
size="medium"
rightIcon={<ArrowRightIcon />}
>
Get Started
</WbButton>
3. Customize with Props
Each component accepts props to control its behavior and appearance:
<WbButton
variant="stroke"
size="large"
disabled={false}
onClick={() => console.log('Clicked!')}
>
Click Me
</WbButton>
Common Components
- WbButton: Primary action button with multiple variants and sizes
- WbInput: Text input field with validation states
- WbBadge: Status indicator and label component
- WbCard: Container for grouped content
- WbAvatar: User profile image component
Design Tokens
WorksBuddy uses CSS variables (custom properties) to define a comprehensive design system. This allows for easy theming and customization without changing component code.
Token Categories
- Colors: Color palettes and semantic colors
- Typography: Font families, sizes, and weights
- Spacing: Consistent spacing scale
- Border Radius: Rounded corner values
- Shadows: Elevation and depth effects
- Transitions: Animation timing
Accessing Tokens
Use tokens in your custom CSS or components:
.custom-element {
background-color: var(--wb-lio-900);
padding: var(--wb-spacing-md);
border-radius: var(--wb-border-radius-lg);
transition: all var(--wb-transition-fast);
}
Complete Token Reference
See the Colors, Typography, and Spacing sections for the complete list of available tokens.
Colors
WorksBuddy includes comprehensive color palettes organized by function and brand themes. All colors are defined as CSS variables for easy customization and theming.
Semantic Colors
Colors with semantic meaning for common states and feedback. Use these for success messages, errors, warnings, and info states.
wb-color-success
#22c55e
wb-color-error
#ef4444
wb-color-warning
#f59e0b
wb-color-info
#3b82f6
Neutral Colors
Grayscale colors for text, borders, backgrounds, and disabled states. These form the foundation of your interface.
Slate - Text & Foreground
Primary text and foreground colors from dark to light.
wb-slate-900
#121212
wb-slate-800
#2a2a2a
wb-slate-700
#414141
wb-slate-600
#5a5a5a
wb-slate-500
#717171
wb-slate-400
#898989
wb-slate-300
#a0a0a0
wb-slate-200
#b8b8b8
wb-slate-100
#d0d0d0
wb-slate-50
#e8e8e8
White - Background
Light background colors for components and containers.
wb-white-50
#ffffff
wb-white-100
#fafafa
wb-white-200
#f2f2f2
wb-white-300
#e8e8e8
wb-white-400
#dddddd
wb-white-500
#d7d7d7
wb-white-600
#cccccc
wb-white-800
#a8a8a8
wb-white-900
#8c8c8c
Grey - Secondary Text
Secondary text and subtle UI elements.
wb-grey-900
#c3c3c3
wb-grey-800
#c5c5c5
wb-grey-700
#cbcbcb
wb-grey-600
#d2d2d2
wb-grey-500
#dddddd
wb-grey-400
#dfdfdf
wb-grey-300
#e5e5e5
wb-grey-200
#ececec
wb-grey-100
#f2f2f2
wb-grey-50
#f9f9f9
Primary Brand Palettes
Seven distinct brand color palettes for different use cases and themes. Each palette has 10 shades from dark (900) to light (50).
LIO - Purple/Violet (Primary)
The main brand color. Used for primary actions, buttons, and highlights.
wb-lio-900
bg-wb-lio-900
#735dff
wb-lio-800
#816eff
wb-lio-700
#8f7dff
wb-lio-600
#9d8eff
wb-lio-500
#ab9eff
wb-lio-400
#b9aeff
wb-lio-300
#c7beff
wb-lio-200
#d5cfff
wb-lio-100
#e3dfff
wb-lio-50
#f1efff
TARO - Green
Success and growth color. Use for positive actions and confirmations.
wb-taro-900
#66b848
wb-taro-800
#76c05b
wb-taro-700
#85c66d
wb-taro-600
#94ce7f
wb-taro-500
#a3d491
wb-taro-400
#b3dca4
wb-taro-300
#c2e3b6
wb-taro-200
#d2eac9
wb-taro-100
#e0f1da
wb-taro-50
#f0f8ed
PRAX - Peach/Salmon
Warm accent color for secondary themes and highlights.
wb-prax-900
#dc8043
wb-prax-800
#e08d56
wb-prax-700
#e39969
wb-prax-600
#e7a77c
wb-prax-500
#eab38e
wb-prax-400
#eec0a1
wb-prax-300
#f1ccb4
wb-prax-200
#f5d9c7
wb-prax-100
#f8e6d9
wb-prax-50
#fcf3ed
EVOX - Blue/Teal
Cool, professional color for tech-focused applications.
wb-evox-900
#127bab
wb-evox-800
#2a89b4
wb-evox-700
#4195bc
wb-evox-600
#5aa3c5
wb-evox-500
#71b0cd
wb-evox-400
#89bdd5
wb-evox-300
#a0cadd
wb-evox-200
#b8d8e6
wb-evox-100
#d0e5ee
wb-evox-50
#e8f2f7
INZO - Purple/Lavender
Soft, creative purple for artistic and design-focused applications.
wb-inzo-900
#8c43a7
wb-inzo-800
#9856b0
wb-inzo-700
#a369b9
wb-inzo-600
#af7cc2
wb-inzo-500
#ba8eca
wb-inzo-400
#c6a1d3
wb-inzo-300
#d1b4dc
wb-inzo-200
#ddc7e5
wb-inzo-100
#e8d9ed
wb-inzo-50
#f4edf7
CORO - Pink/Rose
Vibrant pink for social and community-focused applications.
wb-coro-900
#994369
wb-coro-800
#a45678
wb-coro-700
#ad6987
wb-coro-600
#b87c96
wb-coro-500
#c28ea5
wb-coro-400
#cca1b4
wb-coro-300
#d6b4c3
wb-coro-200
#e1c7d2
wb-coro-100
#ebd9e1
wb-coro-50
#f5edf0
SIGI - Mauve/Dusty Pink
Muted, sophisticated mauve for premium and elegant applications.
wb-sigi-900
#9e606f
wb-sigi-800
#a8707e
wb-sigi-700
#b1808c
wb-sigi-600
#cea4b6
wb-sigi-500
#c5a0a9
wb-sigi-400
#cfb0b7
wb-sigi-300
#d8bfc5
wb-sigi-200
#e2d0d4
wb-sigi-100
#ecdfe2
wb-sigi-50
#f6f0f1
Additional Color Systems
Extended color palettes for specific use cases and states.
Red - Danger/Error
Used for destructive actions and error states.
wb-red-900
#e10303
wb-red-800
#e41d1d
wb-red-700
#e73535
wb-red-600
#ea4f4f
wb-red-500
#ed6868
wb-red-400
#f08181
wb-red-300
#f39a9a
wb-red-200
#f6b4b4
wb-red-100
#f9cdcd
wb-red-50
#fce6e6
Orange - Warning
Used for warnings and caution states.
wb-orange-900
#ffa500
wb-orange-800
#ffae1a
wb-orange-700
#ffb733
wb-orange-600
#ffc04d
wb-orange-500
#ffc966
wb-orange-400
#ffd280
wb-orange-300
#ffdb99
wb-orange-200
#ffe4b3
wb-orange-100
#ffedcc
wb-orange-50
#fff6e6
Blue - Info
Used for informational messages and status.
wb-blue-900
#0c9cfc
wb-blue-800
#25a6fd
wb-blue-700
#3db0fd
wb-blue-600
#55bafd
wb-blue-500
#6dc4fd
wb-blue-400
#86cefe
wb-blue-300
#9ed7fe
wb-blue-200
#b7e2ff
wb-blue-100
#ceebfe
wb-blue-50
#e7f6ff
Green - Success
Used for successful actions and confirmations.
wb-green-900
#0cc763
wb-green-800
#25cd73
wb-green-700
#3dd282
wb-green-600
#55d892
wb-green-500
#6ddda1
wb-green-400
#86e3b1
wb-green-300
#9ee9c1
wb-green-200
#b7efd1
wb-green-100
#b7efd1
wb-green-50
#e7faf0
Background Color Classes
Reference Table
| Class | Property | Description |
|---|---|---|
bg-wb-lio-900 |
background-color: var(--wb-lio-900) |
LIO primary (darkest) |
bg-wb-lio-500 |
background-color: var(--wb-lio-500) |
LIO mid-tone |
bg-wb-lio-50 |
background-color: var(--wb-lio-50) |
LIO lightest |
bg-wb-taro-900 |
background-color: var(--wb-taro-900) |
TARO primary (darkest) |
bg-wb-taro-500 |
background-color: var(--wb-taro-500) |
TARO mid-tone |
bg-wb-taro-50 |
background-color: var(--wb-taro-50) |
TARO lightest |
bg-wb-prax-900 |
background-color: var(--wb-prax-900) |
PRAX primary (darkest) |
bg-wb-prax-500 |
background-color: var(--wb-prax-500) |
PRAX mid-tone |
bg-wb-prax-50 |
background-color: var(--wb-prax-50) |
PRAX lightest |
bg-wb-slate-900 |
background-color: var(--wb-slate-900) |
Slate darkest |
bg-wb-green-900 |
background-color: var(--wb-green-900) |
Green (success) darkest |
bg-wb-red-900 |
background-color: var(--wb-red-900) |
Red (danger) darkest |
Usage Guide
Use colors consistently throughout your application. Follow these guidelines:
- Primary Actions: Use LIO-900 for primary buttons and CTAs
- Hover States: Use LIO-800 or lighter shades for hover effects
- Success Messages: Use TARO-900 or wb-color-success
- Error Messages: Use RED-900 or wb-color-error
- Warnings: Use ORANGE-900 or wb-color-warning
- Info Messages: Use BLUE-900 or wb-color-info
- Backgrounds: Use WHITE shades for main backgrounds, GREY for secondary
- Text: Use SLATE-900 for primary text, SLATE-600 for secondary
- Disabled States: Use GREY or SLATE with reduced opacity
- Brand Themes: Switch entire palettes using TARO, PRAX, EVOX, INZO, CORO, or SIGI for themed applications
Accessibility Considerations
- Ensure sufficient color contrast for text (WCAG AA: 4.5:1 for normal text)
- Don't rely on color alone to convey meaning—use icons, text, or patterns
- Use semantic colors for feedback (success, error, warning, info)
- Test color combinations with accessibility checkers
- Consider colorblind users when selecting complementary colors
Typography
WorksBuddy uses a comprehensive typography system with platform-aware styling for both website and dashboard contexts. The system includes the Onest font family, semantic text components, and consistent design tokens.
Overview
The typography system provides 6 text components (WbHeading, WbPara, WbParaSmall, WbCaption, WbNav, WbHighlight) that automatically adapt their styling based on the platform context. Website typography is larger and more impactful for marketing pages, while dashboard typography is compact for information-dense interfaces.
platform prop to switch
between website and dashboard styles. The default platform varies by
component - check each component's documentation.
Typography Components
WorksBuddy provides 6 typography components for semantic text rendering with platform-aware styles.
Components Overview
| Component | HTML Element | Platforms | Description |
|---|---|---|---|
WbHeading |
h1-h6 | Website, Dashboard | Semantic headings with variant prop |
WbPara |
p | Website, Dashboard | Standard paragraph text |
WbParaSmall |
p | Website, Dashboard | Smaller body text |
WbCaption |
span | Website, Dashboard | Captions and labels |
WbNav |
span | Website only | Navigation links |
WbHighlight |
span | Website, Dashboard | Emphasized/highlighted text |
Heading Styles
WbHeading supports h1-h6 variants with different sizes for website and dashboard platforms.
Website Headings
Large, impactful headings for marketing pages and landing pages.
Dashboard Headings
Compact headings for data-dense dashboard interfaces.
Heading Specifications
| Variant | Website Size | Website Weight | Dashboard Size | Dashboard Weight |
|---|---|---|---|---|
| h1 | 80px | 500 (Medium) | 20px | 700 (Bold) |
| h2 | 68px | 500 (Medium) | 18px | 700 (Bold) |
| h3 | 58px | 500 (Medium) | 14px | 600 (Semibold) |
| h4 | 48px | 500 (Medium) | ||
| h5 | 38px | 500 (Medium) | ||
| h6 | 28px | 500 (Medium) |
<WbHeading variant="h1" platform="website">Website Title</WbHeading>
<WbHeading variant="h1" platform="dashboard">Dashboard Title</WbHeading>
<WbHeading variant="h2" platform="website">Section Heading</WbHeading>
<WbHeading variant="h3" platform="dashboard">Card Title</WbHeading>
Body Text Styles
Paragraph and body text components for content.
Platform Comparison
Website
Para: 28px / Medium
Para Small: 16px / Medium
Caption: 20px / Semibold
Nav: 18px / Medium
Dashboard
Para: 13px / Regular
Para Small: 12px / Regular
Caption: 12px / Regular
Nav: Website only
Body Text Specifications
| Component | Website | Dashboard |
|---|---|---|
WbPara |
28px / 500 / 33px line | 13px / 400 / 18px line |
WbParaSmall |
16px / 500 / 27px line | 12px / 400 / 17px line |
WbCaption |
20px / 600 / 25px line | 12px / 400 / 17px line |
WbNav |
18px / 500 / 23px line | N/A (website only) |
WbHighlight |
28px / 600 / 33px line | 28px / 600 / 33px line |
<WbPara platform="website">Website body text for marketing content.</WbPara>
<WbPara platform="dashboard">Dashboard body text for data interfaces.</WbPara>
<WbParaSmall platform="dashboard">Smaller supporting text.</WbParaSmall>
<WbCaption platform="website">Image Caption</WbCaption>
<WbNav>Navigation Link</WbNav>
<WbHighlight>Important highlighted text</WbHighlight>
Font Size Tokens
CSS variables for consistent font sizing across components.
| Token | Value | Pixels | Usage |
|---|---|---|---|
--wb-font-size-xs |
0.75rem | 12px | Small labels, badges, captions |
--wb-font-size-sm |
0.875rem | 14px | Secondary text, form labels, table cells |
--wb-font-size-md |
1rem | 16px | Default body text, inputs |
--wb-font-size-lg |
1.125rem | 18px | Large body text, navigation |
--wb-font-size-xl |
1.25rem | 20px | Small headings, emphasis |
/* Usage in custom CSS */
.custom-text {
font-size: var(--wb-font-size-md);
}
.small-label {
font-size: var(--wb-font-size-xs);
}
Font Weights
Three weight tokens for consistent text emphasis.
| Token | Value | Usage |
|---|---|---|
--wb-font-weight-medium |
500 | Body text, paragraphs, buttons, labels, website headings |
--wb-font-weight-semibold |
600 | Captions, highlights, dashboard H3 |
--wb-font-weight-bold |
700 | Dashboard H1/H2, strong emphasis |
Text Colors
WorksBuddy provides a comprehensive slate color palette for text hierarchy.
Slate Palette (Text)
Slate 900
#121212 - Primary text
Slate 700
#414141 - Secondary text
Slate 500
#717171 - Tertiary text
Slate 300
#a0a0a0 - Placeholder text
Text Color Tokens
| Token | Value | Usage |
|---|---|---|
--wb-slate-900 |
#121212 | Primary text, headings |
--wb-slate-700 |
#414141 | Secondary text |
--wb-slate-500 |
#717171 | Tertiary text, hints |
--wb-slate-400 |
#898989 | Placeholders |
--wb-slate-300 |
#a0a0a0 | Disabled text |
--wb-color-text |
#333333 | Default body text |
--wb-color-disabled-text |
#9ca3af | Disabled state text |
Semantic Text Colors
Error Text
--wb-color-error: #ef4444
Success Text
--wb-color-success: #22c55e
Warning Text
--wb-color-warning: #f59e0b
Info Text
--wb-color-info: #3b82f6
Usage Examples
Marketing Page Layout
<WbHeading variant="h1" platform="website">
Build Better Products
</WbHeading>
<WbPara platform="website">
WorksBuddy provides everything you need to create amazing user experiences.
</WbPara>
<WbParaSmall platform="website">
Trusted by over 10,000 companies worldwide.
</WbParaSmall>
Navigation
<nav>
<WbNav>Home</WbNav>
<WbNav>Products</WbNav>
<WbNav>About</WbNav>
<WbNav>Contact</WbNav>
</nav>
Using CSS Variables
.custom-component {
font-family: var(--wb-font-family);
font-size: var(--wb-font-size-md);
font-weight: var(--wb-font-weight-medium);
color: var(--wb-slate-900);
line-height: 1.5;
}
.custom-label {
font-size: var(--wb-font-size-sm);
font-weight: var(--wb-font-weight-medium);
color: var(--wb-slate-700);
}
Component Props Reference
WbHeading Props
| Prop | Type | Default | Description |
|---|---|---|---|
variant |
'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' |
Required | Heading level (renders as that HTML element) |
platform |
'website' | 'dashboard' |
'website' |
Platform context for styling |
children |
ReactNode |
Required | Heading content |
className |
string |
'' |
Additional CSS classes |
WbPara / WbParaSmall / WbCaption / WbHighlight Props
| Prop | Type | Default | Description |
|---|---|---|---|
platform |
'website' | 'dashboard' |
Varies by component | Platform context for styling |
children |
ReactNode |
Required | Text content |
className |
string |
'' |
Additional CSS classes |
Spacing
WorksBuddy uses a consistent spacing scale based on a 0.5rem (8px) base unit.
Spacing Scale
| Token | Value | Pixels | Usage |
|---|---|---|---|
--wb-spacing-xs |
0.25rem | 4px | Very small gaps |
--wb-spacing-sm |
0.5rem | 8px | Small gaps |
--wb-spacing-md |
1rem | 16px | Default padding/margin |
--wb-spacing-lg |
1.5rem | 24px | Large gaps |
--wb-spacing-xl |
2rem | 32px | Extra large gaps |
Visual Scale
xs
4px
sm
8px
md
16px
lg
24px
xl
32px
Border Radius
Border radius tokens define the rounding scale. Utility classes let you apply them directly to elements without writing custom CSS.
Design Tokens
| Token | Value | Usage |
|---|---|---|
--wb-border-radius-sm |
0.25rem (4px) | Subtle rounding |
--wb-border-radius-md |
0.375rem (6px) | Default rounding |
--wb-border-radius-lg |
0.5rem (8px) | More rounded |
--wb-border-radius-xl |
0.75rem (12px) | Highly rounded |
All-Corners Utility Classes
Apply the same radius to every corner.
| Class | Value |
|---|---|
wb-rounded-sm |
4px (--wb-border-radius-sm) |
wb-rounded-md |
6px (--wb-border-radius-md) |
wb-rounded-lg |
8px (--wb-border-radius-lg) |
wb-rounded-xl |
12px (--wb-border-radius-xl) |
wb-rounded-full |
9999px (pill / circle) |
wb-rounded-none |
0 (no rounding) |
Visual Examples
4px
6px
8px
12px
9999px
0
Per-Corner & Per-Side Classes
Target individual corners or logical pairs (top, bottom, left,
right). Every pattern is available in sizes:
sm, md, lg, xl,
full, none.
| Pattern | Corners Affected | Example Class |
|---|---|---|
wb-rounded-tl-{size} |
Top-left only | wb-rounded-tl-lg |
wb-rounded-tr-{size} |
Top-right only | wb-rounded-tr-lg |
wb-rounded-bl-{size} |
Bottom-left only | wb-rounded-bl-lg |
wb-rounded-br-{size} |
Bottom-right only | wb-rounded-br-lg |
wb-rounded-t-{size} |
Top-left + Top-right | wb-rounded-t-xl |
wb-rounded-b-{size} |
Bottom-left + Bottom-right | wb-rounded-b-xl |
wb-rounded-l-{size} |
Top-left + Bottom-left | wb-rounded-l-xl |
wb-rounded-r-{size} |
Top-right + Bottom-right | wb-rounded-r-xl |
Per-Side Visual Examples
wb-rounded-t-xl
wb-rounded-b-xl
wb-rounded-l-xl
wb-rounded-r-xl
Usage Examples
<!-- Rounded card (all corners) -->
<div class="wb-rounded-lg">
8px border-radius on all corners
</div>
<!-- Top-only rounding (e.g., card header) -->
<div class="wb-rounded-t-xl">
12px radius on top-left and top-right only
</div>
<!-- Single corner -->
<div class="wb-rounded-tl-lg">
8px radius on top-left corner only
</div>
<!-- Pill shape (buttons, badges) -->
<button class="wb-rounded-full">
Pill Button
</button>
<!-- Combine with border utilities -->
<div class="wb-border wb-border--width-regular wb-border--color-primary wb-rounded-lg">
Rounded border box
</div>
Component Sizes
Components use a consistent sizing scale:
- Giant: 52px height - for prominent actions
- Large: 48px height - for primary actions
- Medium: 40px height - default, most common
- Small: 32px height - for secondary actions
- Tiny: 26px height - for tertiary or compact layouts
Margin
Apply margin using utility classes directly on elements.
Classes
| Class Pattern | Description |
|---|---|
wb-m-{size} |
All sides |
wb-mt-{size} |
Top |
wb-mr-{size} |
Right |
wb-mb-{size} |
Bottom |
wb-ml-{size} |
Left |
wb-mx-{size} |
Horizontal (left + right) |
wb-my-{size} |
Vertical (top + bottom) |
Available Sizes
| Size | Value |
|---|---|
none |
0 |
xs |
2px |
sm |
4px |
md |
8px |
lg |
12px |
xl |
16px |
2xl |
22px |
3xl |
24px |
4xl |
32px |
5xl |
40px |
6xl |
48px |
7xl |
56px |
8xl |
64px |
9xl |
80px |
10xl |
100px |
11xl |
120px |
12xl |
200px |
Visual Examples
The colored area shows the margin space around each box.
margin: 8px
margin: 16px
margin: 32px
Directional Margins
margin-top: 16px
margin-left/right: 16px
margin-top/bottom: 16px
Usage Example
<div className="wb-mt-md wb-mb-lg">
Content with top margin 8px, bottom margin 12px
</div>
<div className="wb-mx-xl wb-my-2xl">
Content with horizontal margin 16px, vertical margin 22px
</div>
Padding
Apply padding using utility classes directly on elements.
Classes
| Class Pattern | Description |
|---|---|
wb-p-{size} |
All sides |
wb-pt-{size} |
Top |
wb-pr-{size} |
Right |
wb-pb-{size} |
Bottom |
wb-pl-{size} |
Left |
wb-px-{size} |
Horizontal (left + right) |
wb-py-{size} |
Vertical (top + bottom) |
Available Sizes
| Size | Value |
|---|---|
none |
0 |
xs |
2px |
sm |
4px |
md |
8px |
lg |
12px |
xl |
16px |
2xl |
22px |
3xl |
24px |
4xl |
32px |
5xl |
40px |
6xl |
48px |
7xl |
56px |
8xl |
64px |
9xl |
80px |
10xl |
100px |
11xl |
120px |
12xl |
200px |
Visual Examples
The colored area shows the padding space inside each box.
padding: 8px
padding: 16px
padding: 32px
Directional Padding
padding-top: 16px
padding-left/right: 16px
padding-top/bottom: 16px
Usage Example
<div className="wb-pt-md wb-pb-lg">
Content with top padding 8px, bottom padding 12px
</div>
<div className="wb-p-4xl">
Content with 32px padding all sides
</div>
Border
Apply borders using utility classes. Combine base class with width and color modifiers.
Base Class
Always include the base class wb-border which sets
border-style: solid.
Width Classes
| Class | Value |
|---|---|
wb-border--width-light |
1px |
wb-border--width-thin |
1.5px |
wb-border--width-regular |
2px |
wb-border--width-medium |
4px |
wb-border--width-semibold |
8px |
wb-border--width-bold |
12px |
wb-border--width-extrabold |
16px |
wb-border--width-black |
20px |
Color Classes
| Class | Color |
|---|---|
wb-border--color-primary |
#1100FF |
wb-border--color-secondary |
#6b7280 |
wb-border--color-gray |
#9ca3af |
Visual Examples
Border Widths
1px
2px
4px
8px
12px
Border Colors
#1100FF
#6b7280
#9ca3af
Side Classes
Apply borders to individual sides only. Combine with width and color classes for full control.
| Class | Effect |
|---|---|
wb-border--top |
Border on top side only |
wb-border--bottom |
Border on bottom side only |
wb-border--left |
Border on left side only |
wb-border--right |
Border on right side only |
Side Examples
wb-border--top
wb-border--bottom
wb-border--left
wb-border--right
Side Usage
<!-- Top border only -->
<div class="wb-border wb-border--top wb-border--width-medium wb-border--color-primary">
Top border only
</div>
<!-- Bottom border only -->
<div class="wb-border wb-border--bottom wb-border--width-regular wb-border--color-secondary">
Bottom border only
</div>
Usage Example
<!-- All sides border -->
<div class="wb-border wb-border--width-medium wb-border--color-primary">
Content with 4px primary border
</div>
<!-- Top border only -->
<div class="wb-border wb-border--top wb-border--width-medium wb-border--color-primary">
Top border only
</div>
<!-- Bottom border only -->
<div class="wb-border wb-border--bottom wb-border--width-regular wb-border--color-secondary">
Bottom border only
</div>
Button Component
Versatile button component with multiple variants, sizes, and states.
Props API
| Prop | Type | Default | Description |
|---|---|---|---|
variant |
'fill' | 'stroke' | 'text' |
'fill' |
Visual style |
size |
'giant' | 'large' | 'medium' | 'small' | 'tiny'
|
'medium' |
Button size |
leftIcon |
ReactNode |
undefined |
Left icon |
rightIcon |
ReactNode |
undefined |
Right icon |
iconOnly |
boolean |
false |
Icon-only mode |
disabled |
boolean |
false |
Disabled state |
onClick |
(e) => void |
undefined |
Click handler |
Variants
Fill (Primary)
<WbButton variant="fill">Button</WbButton>
<WbButton variant="fill" disabled>Disabled</WbButton>
Stroke (Secondary)
<WbButton variant="stroke">Button</WbButton>
<WbButton variant="stroke" disabled>Disabled</WbButton>
Text (Tertiary)
<WbButton variant="text">Button</WbButton>
<WbButton variant="text" disabled>Disabled</WbButton>
Sizes
Fill Sizes
<WbButton size="giant">Giant</WbButton> // 52px
<WbButton size="large">Large</WbButton> // 48px
<WbButton size="medium">Medium</WbButton> // 40px (default)
<WbButton size="small">Small</WbButton> // 32px
<WbButton size="tiny">Tiny</WbButton> // 26px
Stroke Sizes
<WbButton variant="stroke" size="giant">Giant</WbButton>
<WbButton variant="stroke" size="large">Large</WbButton>
<WbButton variant="stroke" size="medium">Medium</WbButton>
<WbButton variant="stroke" size="small">Small</WbButton>
<WbButton variant="stroke" size="tiny">Tiny</WbButton>
Text Sizes
<WbButton variant="text" size="giant">Giant</WbButton>
<WbButton variant="text" size="large">Large</WbButton>
<WbButton variant="text" size="medium">Medium</WbButton>
<WbButton variant="text" size="small">Small</WbButton>
<WbButton variant="text" size="tiny">Tiny</WbButton>
States
Fill States
Stroke States
Text States
Icons
Left Icon
<WbButton leftIcon={<ArrowLeftIcon />}>Back</WbButton>
Right Icon
<WbButton rightIcon={<ArrowRightIcon />}>Next</WbButton>
Icon Only
<WbButton iconOnly aria-label="Upload">
<ArrowUpIcon />
</WbButton>
Icon Only Sizes
<WbButton iconOnly size="giant"><ArrowUpIcon /></WbButton>
<WbButton iconOnly size="large"><ArrowUpIcon /></WbButton>
<WbButton iconOnly size="medium"><ArrowUpIcon /></WbButton>
<WbButton iconOnly size="small"><ArrowUpIcon /></WbButton>
<WbButton iconOnly size="tiny"><ArrowUpIcon /></WbButton>
Button Groups
Primary + Secondary
<WbButton variant="fill">Save</WbButton>
<WbButton variant="stroke">Cancel</WbButton>
Action Hierarchy
<WbButton variant="fill">Confirm</WbButton>
<WbButton variant="stroke">Maybe Later</WbButton>
<WbButton variant="text">Learn More</WbButton>
Tabs with Content Panels
Organize content into separate views with tabbed navigation using compound components. Only one tab's content is visible at a time.
Component API
WbTabGroup Props
| Prop | Type | Default | Description |
|---|---|---|---|
defaultActiveId |
string |
Required | The id of the initially active tab |
activeId |
string |
undefined |
Controlled active tab id |
onTabChange |
(id: string) => void |
undefined |
Callback when active tab changes |
className |
string |
undefined |
Additional CSS class name |
WbTab Props
| Prop | Type | Default | Description |
|---|---|---|---|
id |
string |
Required | Unique identifier matching a WbTabContent id |
disabled |
boolean |
false |
Whether this tab is disabled |
WbTabContent Props
| Prop | Type | Default | Description |
|---|---|---|---|
id |
string |
Required | Unique identifier matching a WbTab id |
States
Basic Usage
Dashboard Content
Welcome to your dashboard! Here you can see an overview of your account activity, recent updates, and quick actions.
Analytics Content
View detailed analytics and insights about your performance. Track metrics, monitor trends, and make data-driven decisions.
Settings Content
Customize your preferences, manage your account settings, and configure notifications to suit your needs.
<WbTabGroup defaultActiveId="dashboard">
<WbTabList>
<WbTab id="dashboard">Dashboard</WbTab>
<WbTab id="analytics">Analytics</WbTab>
<WbTab id="settings">Settings</WbTab>
</WbTabList>
<WbTabContent id="dashboard">
<h4>Dashboard Content</h4>
<p>Welcome to your dashboard!</p>
</WbTabContent>
<WbTabContent id="analytics">
<h4>Analytics Content</h4>
<p>View detailed analytics...</p>
</WbTabContent>
<WbTabContent id="settings">
<h4>Settings Content</h4>
<p>Customize your preferences...</p>
</WbTabContent>
</WbTabGroup>
With Disabled Tab
Active Tab Content
This is the content for the active tab.
Default Tab Content
This is the content for the default tab.
Disabled Tab Content
This content cannot be accessed.
<WbTabGroup defaultActiveId="active">
<WbTabList>
<WbTab id="active">Active</WbTab>
<WbTab id="default">Default</WbTab>
<WbTab id="disabled" disabled>Disabled</WbTab>
</WbTabList>
<WbTabContent id="active">
<h4>Active Tab Content</h4>
<p>This is the content for the active tab.</p>
</WbTabContent>
<WbTabContent id="default">
<h4>Default Tab Content</h4>
<p>This is the content for the default tab.</p>
</WbTabContent>
<WbTabContent id="disabled">
<h4>Disabled Tab Content</h4>
<p>This content cannot be accessed.</p>
</WbTabContent>
</WbTabGroup>
Default Active Tab
<WbTabGroup defaultActiveId="analytics">
<WbTabList>
<WbTab id="dashboard">Dashboard</WbTab>
<WbTab id="analytics">Analytics</WbTab>
<WbTab id="reports">Reports</WbTab>
</WbTabList>
<WbTabContent id="dashboard">
<p>Dashboard content</p>
</WbTabContent>
<WbTabContent id="analytics">
<p>Analytics content (active by default)</p>
</WbTabContent>
<WbTabContent id="reports">
<p>Reports content</p>
</WbTabContent>
</WbTabGroup>
Controlled Usage
const [activeTab, setActiveTab] = useState("dashboard");
<WbTabGroup
defaultActiveId="dashboard"
activeId={activeTab}
onTabChange={setActiveTab}
>
<WbTabList>
<WbTab id="dashboard">Dashboard</WbTab>
<WbTab id="analytics">Analytics</WbTab>
<WbTab id="reports">Reports</WbTab>
</WbTabList>
<WbTabContent id="dashboard">
<p>Dashboard content</p>
</WbTabContent>
<WbTabContent id="analytics">
<p>Analytics content</p>
</WbTabContent>
<WbTabContent id="reports">
<p>Reports content</p>
</WbTabContent>
</WbTabGroup>
DataTable Component
A powerful, feature-rich data table for displaying, selecting, and editing tabular data. Supports multiple column types, row selection, inline editing, and responsive design.
Overview
The DataTable component provides a comprehensive solution for displaying structured data in rows and columns. It supports various column types (text, avatar, status badges, priority, scores, links), row selection with checkboxes, inline edit buttons, and custom cell rendering. The table is fully responsive with horizontal scrolling on smaller screens.
Props API
DataTable Props
| Prop | Type | Default | Description |
|---|---|---|---|
columns |
Column<T>[] |
Required | Array of column configurations |
data |
T[] |
Required | Array of data rows to display |
selectable |
boolean |
true |
Enable row selection with checkboxes |
selectedRows |
Set<number> |
undefined |
Controlled selected rows state |
onSelectionChange |
(selected: Set<number>) => void |
undefined |
Callback when row selection changes |
onEdit |
(rowIndex, columnKey, row) => void |
undefined |
Callback when edit button is clicked |
rowKey |
keyof T | ((row, index) => string) |
index |
Unique identifier for each row |
className |
string |
'' |
Additional CSS class for wrapper |
style |
CSSProperties |
undefined |
Inline styles for wrapper |
Column Configuration
| Property | Type | Description |
|---|---|---|
key |
string |
Unique key mapping to data property |
header |
string |
Header text displayed in column |
type |
ColumnType |
Column type for automatic rendering |
width |
string |
CSS width (e.g., '200px', '20%') |
render |
(value, row, index) => ReactNode |
Custom render function for cell |
editable |
boolean |
Show edit button in cell |
Column Types
The DataTable supports 10 built-in column types for common data display patterns.
| Type | Example | Description |
|---|---|---|
text |
John Smith | Plain text display (default) |
avatar-text |
J
John Smith
|
Avatar image/initial with text |
phone |
+1 (555) 123-4567 | Phone number display |
status |
Completed | Status badge with color variants |
priority |
High | Priority badge with color variants |
score |
85 | Circular score badge |
link |
View Details ↗ | Link-style text with icon |
date |
Jan 15, 2025 | Date display |
assignee |
Sarah Johnson | Assignee name display |
custom |
Your custom JSX | Custom render function |
Status Badges
Status badges indicate the current state of an item. Five variants are available.
// Status column with variant
{
key: 'status',
header: 'Status',
type: 'status',
}
// Data format
{ status: { text: 'Completed', variant: 'success' } }
// Or simple string (defaults to 'success')
{ status: 'Completed' }
Priority Badges
Priority badges indicate urgency or importance levels.
// Priority column
{
key: 'priority',
header: 'Priority',
type: 'priority',
}
// Data format
{ priority: { text: 'High', variant: 'high' } }
Score Badges
Circular badges for displaying numeric scores or ratings.
// Score column
{
key: 'score',
header: 'Score',
type: 'score',
}
// Data format
{ score: { value: 85, variant: 'success' } }
// Or simple number (defaults to 'success')
{ score: 85 }
Avatar Cells
Display user avatars with names. Shows image if provided, otherwise displays initial.
// Avatar column
{
key: 'user',
header: 'Name',
type: 'avatar-text',
}
// Data formats
{ user: { src: 'https://example.com/avatar.jpg', text: 'John Smith' } }
// Or just text (shows initial)
{ user: 'John Smith' }
Row Selection
Enable row selection with circular checkboxes. Supports single row and select all.
| Name | Status | Date | |
|---|---|---|---|
| John Smith | Active | Jan 15, 2025 | |
| Sarah Johnson | Pending | Jan 14, 2025 |
const [selectedRows, setSelectedRows] = useState<Set<number>>(new Set());
<WbDataTable
columns={columns}
data={data}
selectable={true}
selectedRows={selectedRows}
onSelectionChange={(selected) => setSelectedRows(selected)}
/>
Editable Cells
Add edit buttons to cells for inline editing triggers.
| Name | Phone | |
|---|---|---|
|
John Smith
|
+1 (555) 123-4567
|
Edit buttons appear on editable columns
const columns = [
{ key: 'name', header: 'Name', editable: true },
{ key: 'phone', header: 'Phone', type: 'phone', editable: true },
{ key: 'email', header: 'Email', editable: true },
];
<WbDataTable
columns={columns}
data={data}
onEdit={(rowIndex, columnKey, row) => {
console.log('Edit:', rowIndex, columnKey, row);
openEditModal(rowIndex, columnKey);
}}
/>
Row States
Table rows support different visual states based on interaction and selection.
| State | Name | Status |
|---|---|---|
| Default | Normal Row | Active |
| Hover | Hovered Row | Pending |
| Selected | Selected Row | Review |
Default, Hover (subtle), and Selected (blue tint)
Complete Example
Full-featured table with selection, multiple column types, and edit functionality.
| Name | Phone | Status | Lead Source | Priority | Score | Created | Assignee | ||
|---|---|---|---|---|---|---|---|---|---|
| Aarav Mehta | +91 9876543210 |
Done
|
Website Form
|
High |
41
|
10 Nov 2025 |
Priya Sharma
|
||
| Aarav Mehta | +91 9876543210 |
Done
|
Website Form
|
High |
41
|
10 Nov 2025 |
Priya Sharma
|
||
| Aarav Mehta | +91 9876543210 |
Done
|
Website Form
|
High |
41
|
10 Nov 2025 |
Priya Sharma
|
||
| Aarav Mehta | +91 9876543210 |
Done
|
Website Form
|
High |
41
|
10 Nov 2025 |
Priya Sharma
|
||
| Aarav Mehta | +91 9876543210 |
Done
|
Website Form
|
High |
41
|
10 Nov 2025 |
Priya Sharma
|
||
| Aarav Mehta | +91 9876543210 |
Done
|
Website Form
|
High |
41
|
10 Nov 2025 |
Priya Sharma
|
||
| Aarav Mehta | +91 9876543210 |
Done
|
Website Form
|
High |
41
|
10 Nov 2025 |
Priya Sharma
|
||
| Aarav Mehta | +91 9876543210 |
Done
|
Website Form
|
High |
41
|
10 Nov 2025 |
Priya Sharma
|
||
| Aarav Mehta | +91 9876543210 |
Done
|
Website Form
|
High |
41
|
10 Nov 2025 |
Priya Sharma
|
import { WbDataTable } from 'works-buddy';
const columns = [
{ key: 'name', header: 'Name', type: 'text' },
{ key: 'email', header: 'Email', type: 'avatar-text' },
{ key: 'phone', header: 'Phone', type: 'phone' },
{ key: 'status', header: 'Status', type: 'status', editable: true },
{ key: 'leadSource', header: 'Lead Source', type: 'link' },
{ key: 'priority', header: 'Priority', type: 'priority' },
{ key: 'score', header: 'Score', type: 'score', editable: true },
{ key: 'created', header: 'Created', type: 'date' },
{ key: 'assignee', header: 'Assignee', type: 'assignee', editable: true },
];
const data = [
{
name: 'Aarav Mehta',
email: { text: '[email protected]', src: '/avatars/arjun.jpg' },
phone: '+91 9876543210',
status: { text: 'Done', variant: 'success' },
leadSource: 'Website Form',
priority: { text: 'High', variant: 'high' },
score: { value: 41, variant: 'error' },
created: '10 Nov 2025',
assignee: 'Priya Sharma',
},
// ... more rows
];
<WbDataTable
columns={columns}
data={data}
selectable={true}
onSelectionChange={(selected) => console.log(selected)}
onEdit={(rowIndex, columnKey, row) => {
console.log('Edit:', rowIndex, columnKey, row);
}}
/>
Custom Cell Rendering
Use the render function for complete control over cell
content.
const columns = [
{
key: 'actions',
header: 'Actions',
type: 'custom',
render: (value, row, index) => (
<div style={{ display: 'flex', gap: '8px' }}>
<button onClick={() => handleView(row)}>View</button>
<button onClick={() => handleEdit(row)}>Edit</button>
<button onClick={() => handleDelete(row)}>Delete</button>
</div>
),
},
{
key: 'progress',
header: 'Progress',
render: (value) => (
<div className="progress-bar">
<div style={{ width: `${value}%` }} />
</div>
),
},
];
Input Component
Text input fields for user data entry with validation states and
accessibility features. WorksBuddy provides two Input components: a
basic Input with label and error support, and a branded
WbInput with status variants and preset widths.
Overview
The Input components provide a consistent way to collect text input
from users. The basic Input component supports labels,
error messages, and all standard HTML input attributes. The branded
WbInput component offers 7 status variants (default,
hover, focus, success, info, warning, error) and 5 width options for
design system consistency.
Input component for
forms with labels and validation. Use WbInput for
branded interfaces requiring visual status feedback.
WbInput Props API
| Prop | Type | Default | Description |
|---|---|---|---|
status |
'default' | 'hover' | 'focus' | 'success' | 'info' |
'warning' | 'error'
|
'default' |
Visual status variant with color-coded feedback |
width |
'xs' | 'sm' | 'md' | 'lg' | 'xl' |
'md' |
Preset width: xs (203px), sm (270px), md (353px), lg (416px), xl (494px) |
value |
string |
undefined |
Controlled input value |
placeholder |
string |
'Text' |
Placeholder text displayed when empty |
onChange |
(value: string) => void |
undefined |
Callback with the new value when input changes |
disabled |
boolean |
false |
Disable the input and prevent interaction |
Input Props API
| Prop | Type | Default | Description |
|---|---|---|---|
label |
string |
undefined |
Label text displayed above the input |
error |
string |
undefined |
Error message displayed below the input |
id |
string |
auto-generated |
HTML id attribute (auto-generated from label if not provided) |
className |
string |
'' |
Additional CSS classes |
| ...plus all standard HTML input attributes (type, placeholder, value, onChange, disabled, required, etc.) | |||
Status Variants
WbInput supports 7 status variants for visual feedback. Status changes border and background colors to communicate state.
All Status States
Default
Gray border, white bg
Hover
Purple border, white bg
Focus
Purple border, light purple bg
Success
Green border, light green bg
Info
Blue border, light blue bg
Warning
Orange border, light orange bg
Error
Red border, light red bg
Disabled
60% opacity, not interactive
Status Colors Reference
| Status | Border Color | Background | Use Case |
|---|---|---|---|
default |
#d1d5db (gray) | #ffffff (white) | Normal, inactive state |
hover |
#735DFF (purple) | #ffffff (white) | Mouse hover interaction |
focus |
#735DFF (purple) | #F1EFFF (light purple) | Keyboard/click focus |
success |
#B7EFD1 (green) | #E7FAF0 (light green) | Validation passed |
info |
#0C9CFC (blue) | #CEEBFE (light blue) | Informational feedback |
warning |
#FFA500 (orange) | #FFF6E6 (light orange) | Caution needed |
error |
#E10303 (red) | #FCE6E6 (light red) | Validation failed |
<WbInput status="default" placeholder="Enter text" />
<WbInput status="success" placeholder="Valid input" />
<WbInput status="error" placeholder="Invalid input" />
<WbInput status="warning" placeholder="Caution" />
<WbInput status="info" placeholder="Info" />
Width Variants
WbInput supports 5 preset width options for consistent layouts. Choose based on expected content length.
All Width Sizes
<WbInput width="xs" placeholder="Code" />
<WbInput width="sm" placeholder="Phone" />
<WbInput width="md" placeholder="Email" /> {/* Default */}
<WbInput width="lg" placeholder="Full Name" />
<WbInput width="xl" placeholder="URL" />
Width Selection Guide
| Width | Pixels | Best For |
|---|---|---|
xs |
203px | Short codes, quantities, small values |
sm |
270px | Phone numbers, zip codes, short names |
md |
353px | Email addresses, usernames, standard fields |
lg |
416px | Full names, addresses, longer content |
xl |
494px | URLs, file paths, long descriptions |
Input with Label and Error
The basic Input component supports integrated labels
and error messages for form scenarios.
With Label
<Input
label="Email Address"
type="email"
placeholder="Enter your email"
/>
With Error Message
<Input
label="Password"
type="password"
placeholder="Enter password"
error="Password must be at least 8 characters"
/>
Without Label
<Input
type="text"
placeholder="Search..."
aria-label="Search"
/>
Component Comparison
Choose the right Input component for your use case:
| Feature | Input | WbInput |
|---|---|---|
| Built-in label | Yes | No |
| Error message display | Yes | No |
| Status variants | Default + Error | 7 variants |
| Preset widths | No | 5 sizes (xs-xl) |
| HTML input types | All types | Text only |
| Best for | Forms with validation | Branded UI, dashboards |
Badge Component
Small status labels and indicators for displaying categories, counts, and status information. Badges provide visual differentiation through color-coded status variants and two size options.
Overview
The WbBadge component displays compact labeled information with an optional count value. It's useful for status indicators, category tags, notification counts, and inline labels. The component supports 5 status colors (default, success, info, warning, error) and 2 sizes (medium, small).
Props API
| Prop | Type | Default | Description |
|---|---|---|---|
label |
string |
Required | Label text displayed on the left side of the badge |
count |
string | number |
undefined |
Optional count or value displayed on the right side |
status |
'default' | 'success' | 'info' | 'warning' | 'error'
|
'default' |
Color variant indicating status or category |
size |
'medium' | 'small' |
'medium' |
Badge size variant |
Status Variants
WbBadge supports 5 status variants with distinct background colors for visual categorization and semantic meaning.
All Status Colors
Default
Gray - Neutral category
Success
Green - Positive status
Info
Blue - Informational
Warning
Yellow - Caution needed
Error
Red - Error or critical
Status Colors Reference
| Status | Background | Text Color | Use Case |
|---|---|---|---|
default |
#CBCDCF (gray) | #000000 (black) | Neutral categories, general labels, inactive items |
success |
#B7EFD1 (green) | #000000 (black) | Active status, completed tasks, approved items |
info |
#CEEBFE (blue) | #000000 (black) | New items, informational, updates available |
warning |
#FFF6E6 (yellow) | #000000 (black) | Pending actions, requires attention, expiring soon |
error |
#FCE6E6 (red) | #000000 (black) | Blocked items, errors, critical issues, overdue |
<WbBadge label="Category" status="default" />
<WbBadge label="Active" status="success" />
<WbBadge label="New" status="info" />
<WbBadge label="Pending" status="warning" />
<WbBadge label="Blocked" status="error" />
Size Variants
WbBadge supports 2 size variants to fit different contexts and visual hierarchies.
Size Comparison
Size Specifications
| Size | Label Dimensions | Count Dimensions | Font Size | Best For |
|---|---|---|---|---|
medium |
min 61px × 22px | min 22px × 22px | 11px | Standard use, tables, cards, prominent display |
small |
min 51px × 18px | min 22px × 19px | 8px | Compact layouts, lists, dense interfaces |
<WbBadge label="Manager" count={41} size="medium" />
<WbBadge label="Manager" count={41} size="small" />
Badge Variations
Badges can be used with or without the count element for different use cases.
Label Only (No Count)
<WbBadge label="Active" status="success" />
<WbBadge label="Pending" status="warning" />
<WbBadge label="Expired" status="error" />
<WbBadge label="Beta" status="info" />
Label with Count
<WbBadge label="Users" count={156} />
<WbBadge label="Online" count={42} status="success" />
<WbBadge label="Issues" count={7} status="error" />
String Count Values
<WbBadge label="Version" count="2.1" status="info" />
<WbBadge label="Status" count="OK" status="success" />
<WbBadge label="Priority" count="P1" status="warning" />
Radio Component
Radio buttons allow users to select a single option from a set of mutually exclusive choices. The WbRadio component supports multiple sizes, visual states, and optional labels with full accessibility support.
Overview
The WbRadio component provides a customizable radio button with 3 size variants (sm, md, lg) and 5 visual states (default, hover, focus, selected, disabled). It uses native HTML radio input under the hood for proper form integration and accessibility, while providing a consistent branded appearance.
name attribute to
group related radio buttons together.
Props API
| Prop | Type | Default | Description |
|---|---|---|---|
label |
string |
undefined |
Optional label text displayed next to the radio button |
size |
'sm' | 'md' | 'lg' |
'md' |
Size variant: small (20px), medium (24px), large (28px) |
state |
'default' | 'hover' | 'focus' | 'selected' |
'disabled'
|
'default' |
Visual state for design showcase (use native attributes in production) |
name |
string |
undefined |
Groups radio buttons together - same name = same group |
value |
string |
undefined |
Value submitted when this radio is selected |
checked |
boolean |
false |
Whether the radio is selected (controlled) |
disabled |
boolean |
false |
Disables the radio button |
onChange |
(e: ChangeEvent) => void |
undefined |
Callback when radio selection changes |
| ...plus all standard HTML input attributes (id, className, aria-*, etc.) | |||
States
WbRadio supports 5 visual states that change based on user
interaction. States are managed automatically through native HTML
behavior, but can also be set explicitly via the
state prop for design showcases.
All States (Without Label)
Default
Purple border, white bg
Hover
Light purple background
Focus
4px purple focus ring
Selected
Inner dot visible
Disabled
Gray, non-interactive
All States (With Label)
Default
Hover
Focus
Selected
Disabled
State Colors Reference
| State | Border | Background | Additional |
|---|---|---|---|
default |
#735DFF (purple) | #FFFFFF (white) | - |
hover |
#735DFF (purple) | #C6BDFF (light purple) | - |
focus |
#735DFF (purple) | #FFFFFF (white) | 4px box-shadow #D5CFFF |
selected |
#735DFF (purple) | #FFFFFF (white) | Inner dot #735DFF visible |
disabled |
#D1D5DB (gray) | #F3F4F6 (light gray) | Label color #9CA3AF |
<WbRadio name="demo" state="default" label="Default" />
<WbRadio name="demo" state="hover" label="Hover" />
<WbRadio name="demo" state="focus" label="Focus" />
<WbRadio name="demo" state="selected" label="Selected" />
<WbRadio name="demo" state="disabled" label="Disabled" />
Size Variants
WbRadio supports 3 size variants to fit different contexts and visual hierarchies.
Size Comparison
Size Specifications
| Size | Control Dimensions | Inner Dot | Best For |
|---|---|---|---|
sm |
20px × 20px | 10px diameter | Compact forms, dense interfaces, mobile |
md |
24px × 24px | 12px diameter | Standard forms, general use (default) |
lg |
28px × 28px | 14px diameter | Prominent choices, touch interfaces, accessibility |
All Sizes - Selected State
<WbRadio name="size-demo" size="sm" label="Small" />
<WbRadio name="size-demo" size="md" label="Medium" /> {/* Default */}
<WbRadio name="size-demo" size="lg" label="Large" />
Radio Groups
Radio buttons work in groups where only one option can be selected
at a time. Use the same name attribute to group related
options.
Basic Radio Group
<WbRadio name="options" value="a" label="Option A" checked />
<WbRadio name="options" value="b" label="Option B" />
<WbRadio name="options" value="c" label="Option C" />
Group with Disabled Option
<WbRadio name="availability" value="available" label="Available" />
<WbRadio name="availability" value="selected" label="Selected" checked />
<WbRadio name="availability" value="unavailable" label="Unavailable" disabled />
Checkbox Component
Checkboxes allow users to select one or more options from a set, or toggle a single option on/off. The WbCheckbox component supports multiple visual states, optional labels with flexible positioning, and includes an indeterminate state for partial selections.
Overview
The WbCheckbox component provides a customizable checkbox with 6 visual states (default, hover, focus, selected, indeterminate, disabled) and optional labels that can be positioned on either side. It includes proper ARIA attributes for accessibility and supports both controlled and showcase usage patterns.
Props API
| Prop | Type | Default | Description |
|---|---|---|---|
status |
'default' | 'hover' | 'focus' | 'selected' |
'indeterminate' | 'disabled'
|
'default' |
Visual state for design showcase |
checked |
boolean |
false |
Whether the checkbox is checked (controlled) |
label |
string |
undefined |
Optional label text displayed next to the checkbox |
labelPosition |
'left' | 'right' |
'right' |
Position of the label relative to the checkbox |
onChange |
(checked: boolean) => void |
undefined |
Callback when checkbox state changes |
States
WbCheckbox supports 6 visual states that represent different interaction and selection states.
All States (Without Label)
Default
Purple border, white bg
Hover
Light purple bg & border
Focus
3px purple focus ring
Selected
Purple bg, white checkmark
Indeterminate
Purple bg, white dash
Disabled
Gray border, not interactive
All States (With Label - Right)
Default
Hover
Focus
Selected
Indeterminate
Disabled
State Colors Reference
| State | Border | Background | Icon | Additional |
|---|---|---|---|---|
default |
#735DFF (purple) | #FFFFFF (white) | - | - |
hover |
#C6BDFF (light purple) | #F1EFFF (light purple) | - | - |
focus |
#735DFF (purple) | #FFFFFF (white) | - | 3px box-shadow #D5CFFF |
selected |
#735DFF (purple) | #735DFF (purple) | #FFFFFF checkmark | - |
indeterminate |
#735DFF (purple) | #735DFF (purple) | #FFFFFF dash | For partial selection |
disabled |
#E5E7EA (gray) | #FFFFFF (white) | - | Label color #9EA2AE |
<WbCheckbox status="default" label="Default" />
<WbCheckbox status="selected" label="Selected" />
<WbCheckbox status="indeterminate" label="Indeterminate" />
<WbCheckbox status="disabled" label="Disabled" />
Label Position
Labels can be positioned on either side of the checkbox for flexible layout options.
Label Right (Default)
<WbCheckbox label="Label on right" />
<WbCheckbox label="Label on right" labelPosition="right" />
Label Left
<WbCheckbox label="Label on left" labelPosition="left" />
Without Label
<WbCheckbox />
<WbCheckbox status="selected" />
<WbCheckbox status="indeterminate" />
Indeterminate State
The indeterminate state is used when a checkbox represents a group of options where some (but not all) are selected. This is common in "select all" scenarios.
Example: Parent-Child Selection
// Parent checkbox shows indeterminate when some children are selected
const allSelected = children.every(c => c.selected);
const someSelected = children.some(c => c.selected);
<WbCheckbox
label="Select All Features"
status={allSelected ? 'selected' : someSelected ? 'indeterminate' : 'default'}
checked={allSelected}
onChange={handleSelectAll}
/>
Checkbox Groups
Unlike radio buttons, multiple checkboxes can be selected independently. Group related checkboxes together logically.
Multiple Selection
<WbCheckbox label="Email notifications" checked={prefs.email} onChange={...} />
<WbCheckbox label="SMS notifications" checked={prefs.sms} onChange={...} />
<WbCheckbox label="Push notifications" checked={prefs.push} onChange={...} />
<WbCheckbox label="In-app notifications (coming soon)" status="disabled" />
Progress Bar Component
Progress bars visually indicate the completion status of a task or process. The WbProgress component supports multiple sizes, flexible label positioning, and smooth animations with full accessibility support.
Overview
The WbProgress component displays a horizontal bar that fills based on a percentage value. It supports 3 size variants (sm, md, lg), 3 label positions (left, right, none), and includes proper ARIA attributes for accessibility. The fill animation provides smooth visual feedback when the value changes.
Props API
| Prop | Type | Default | Description |
|---|---|---|---|
value |
number |
0 |
Current progress value (0-100) |
max |
number |
100 |
Maximum value for calculating percentage |
size |
'sm' | 'md' | 'lg' |
'md' |
Size variant: small (4px), medium (8px), large (12px) |
labelPosition |
'left' | 'right' | 'none' |
'left' |
Position of the percentage label |
showLabel |
boolean |
true |
Whether to display the percentage label |
className |
string |
'' |
Additional CSS classes |
Basic Examples
Progress bars showing different completion states from 0% to 100%.
Progress Values
<WbProgress value={0} />
<WbProgress value={25} />
<WbProgress value={50} />
<WbProgress value={75} />
<WbProgress value={100} />
Size Variants
WbProgress supports 3 size variants for different UI contexts and visual prominence.
Size Comparison
Size Specifications
| Size | Track Height | Border Radius | Label Font Size | Best For |
|---|---|---|---|---|
sm |
4px | 2px | 12px (0.75rem) | Compact layouts, inline indicators, lists |
md |
8px | 4px | 14px | Standard use, cards, dashboards (default) |
lg |
12px | 6px | 16px (1rem) | Prominent displays, hero sections, focus areas |
<WbProgress value={60} size="sm" />
<WbProgress value={60} size="md" /> {/* Default */}
<WbProgress value={60} size="lg" />
Label Position
The percentage label can be positioned on either side of the progress bar or hidden entirely.
Label Left (Default)
<WbProgress value={45} labelPosition="left" />
Label Right
<WbProgress value={45} labelPosition="right" />
No Label
<WbProgress value={45} labelPosition="none" />
{/* Or use showLabel prop */}
<WbProgress value={45} showLabel={false} />
Colors
The progress bar uses the WorksBuddy design system colors.
Color Reference
| Element | CSS Variable | Default Value | Description |
|---|---|---|---|
| Track (background) | --wb-color-primary-soft |
#e8e4f3 | Light purple/lavender background |
| Fill (progress) | --wb-color-primary |
#6b4ce6 | Primary purple fill color |
| Label text | - | #131927 | Dark text color |
Customizing Colors
/* Override colors via CSS variables */
:root {
--wb-color-primary: #22c55e; /* Green fill */
--wb-color-primary-soft: #dcfce7; /* Light green track */
}
/* Or use custom className */
.progress-success .wb-progress__fill {
background-color: #22c55e;
}
.progress-success .wb-progress__track {
background-color: #dcfce7;
}
List Component
Lists display a series of items with visual markers. WbList supports ordered (numbered) and unordered (star bullet) styles.
Props API
WbList Props
| Prop | Type | Default | Description |
|---|---|---|---|
type |
'ordered' | 'unordered' |
'unordered' |
List style: numbered circles or star bullets |
children |
ReactNode |
Required | WbListItem elements |
className |
string |
'' |
Additional CSS classes |
WbListItem Props
| Prop | Type | Default | Description |
|---|---|---|---|
children |
ReactNode |
Required | Content of the list item |
className |
string |
'' |
Additional CSS classes |
Unordered List
Displays items with star bullet markers (24px).
- First list item
- Second list item
- Third list item
<WbList type="unordered">
<WbListItem>First list item</WbListItem>
<WbListItem>Second list item</WbListItem>
<WbListItem>Third list item</WbListItem>
</WbList>
Ordered List
Displays items with numbered circle markers (32px).
- 1 Create your account
- 2 Configure your settings
- 3 Start using the app
<WbList type="ordered">
<WbListItem>Create your account</WbListItem>
<WbListItem>Configure your settings</WbListItem>
<WbListItem>Start using the app</WbListItem>
</WbList>
Styling Details
| Property | Unordered | Ordered |
|---|---|---|
| Icon Size | 24px (star) | 32px (circle) |
| Icon Color | #4F5BD5 (purple stroke) | #4E61F6 (purple fill) |
| Font Size | 16px | 16px |
| Item Gap | 12px | 12px |
| Icon-Text Gap | 12px | 12px |
Alert Component
Alerts display important messages with color-coded variants for different types of feedback.
Props API
| Prop | Type | Default | Description |
|---|---|---|---|
variant |
'success' | 'error' | 'info' | 'warning' |
'info' |
Alert type with color-coded styling |
children |
ReactNode |
Required | Alert message content |
icon |
ReactNode |
undefined |
Custom icon (uses default if not provided) |
showIcon |
boolean |
true |
Whether to display the icon |
Variants
<WbAlert variant="success">Success! Your changes have been saved.</WbAlert>
<WbAlert variant="error">Error! Something went wrong.</WbAlert>
<WbAlert variant="info">Info: New features are available.</WbAlert>
<WbAlert variant="warning">Warning: Your session will expire soon.</WbAlert>
Without Icon
<WbAlert variant="info" showIcon={false}>
This alert has no icon.
</WbAlert>
Variant Colors
| Variant | Border Color | Icon Color | Use For |
|---|---|---|---|
success |
#0CC790 (green) | #0CC790 | Confirmations, completed actions |
error |
#E10303 (red) | #E10303 | Errors, failed actions |
info |
#0C9CFC (blue) | #0C9CFC | Information, tips |
warning |
#FFA500 (orange) | #FFA500 | Warnings, cautions |
Loader Component
Animated circular loading spinner to indicate loading states. The WbLoader uses an SVG-based arc design with customizable size, color, speed, and optional track.
Props API
| Prop | Type | Default | Description |
|---|---|---|---|
size |
'xs' | 'sm' | 'md' | 'lg' | 'xl' |
'md' |
Size of the loader (24px to 56px) |
color |
'primary' | 'secondary' | 'success' | 'danger' | 'warning'
| 'info' | 'light' | 'dark'
|
'primary' |
Color of the spinner arc |
speed |
'slow' | 'normal' | 'fast' | 'faster' |
'normal' |
Animation speed (1500ms to 500ms) |
strokeWidth |
'thin' | 'normal' | 'medium' | 'thick' | 'bold'
|
Based on size | Thickness of the spinner arc (2px to 8px) |
showTrack |
boolean |
false |
Show background track circle |
trackColor |
WbLoaderColor |
'primary' |
Color of the track circle |
trackOpacity |
'light' | 'normal' | 'medium' | 'strong' |
'normal' |
Opacity of the track (0.1 to 0.5) |
visible |
boolean |
true |
Whether loader is visible |
label |
string |
'Loading' |
Screen reader label for accessibility |
Sizes
WbLoader supports 5 size options. Each size has a proportional default stroke width.
<WbLoader size="xs" /> {/* 24px */}
<WbLoader size="sm" /> {/* 32px */}
<WbLoader size="md" /> {/* 40px - default */}
<WbLoader size="lg" /> {/* 48px */}
<WbLoader size="xl" /> {/* 56px */}
Colors
8 color options to match your design system.
<WbLoader color="primary" /> {/* #735DFF */}
<WbLoader color="secondary" /> {/* #6b7280 */}
<WbLoader color="success" /> {/* #10b981 */}
<WbLoader color="danger" /> {/* #ef4444 */}
<WbLoader color="warning" /> {/* #f59e0b */}
<WbLoader color="info" /> {/* #3b82f6 */}
With Track
Show an optional background track circle behind the spinner arc.
<WbLoader showTrack />
<WbLoader showTrack={false} />
Animation Speeds
Control the rotation speed with 4 preset options.
<WbLoader speed="slow" /> {/* 1500ms */}
<WbLoader speed="normal" /> {/* 1000ms - default */}
<WbLoader speed="fast" /> {/* 700ms */}
<WbLoader speed="faster" /> {/* 500ms */}
Size Reference
| Size | Pixels | Default Stroke |
|---|---|---|
xs |
24px | 3px |
sm |
32px | 3.5px |
md |
40px | 4px |
lg |
48px | 4.5px |
xl |
56px | 5px |
Color Reference
| Color | Value |
|---|---|
primary |
#735DFF |
secondary |
#6b7280 |
success |
#10b981 |
danger |
#ef4444 |
warning |
#f59e0b |
info |
#3b82f6 |
light |
#e5e7eb |
dark |
#1f2937 |
Speed Reference
| Speed | Duration |
|---|---|
slow |
1500ms |
normal |
1000ms |
fast |
700ms |
faster |
500ms |
Stroke Width Reference
| Stroke Width | Pixels |
|---|---|
thin |
2px |
normal |
4px |
medium |
5px |
thick |
6px |
bold |
8px |
Stats Card Component
Display statistics with title, value, and active/inactive counts.
Basic Props
| Prop | Type | Default | Description |
|---|---|---|---|
title |
string |
Required | Card title text |
value |
number | string |
Required | Main value displayed |
activeCount |
number |
Required | Active count in status |
inactiveCount |
number |
Required | Inactive count in status |
activeLabel |
string |
'active' |
Label for active status |
inactiveLabel |
string |
'inactive' |
Label for inactive status |
Basic Usage
<WbStatsCard title="Total Leads" value={26} activeCount={17} inactiveCount={2} bgColor="cyan" icon={<WbIconDownload />} />
<WbStatsCard title="Assigned" value={129} activeCount={17} inactiveCount={2} bgColor="green" iconColor="green" activeColor="green" icon={<WbIconCheck />} />
<WbStatsCard title="In progress" value={129} activeCount={17} inactiveCount={2} bgColor="yellow" iconColor="yellow" activeColor="yellow" icon={<WbIconClock />} />
<WbStatsCard title="Lost" value="94%" activeCount={6} inactiveCount={100} bgColor="red" iconColor="red" activeColor="red" activeLabel="% left" inactiveLabel="%" icon={<WbIconClose />} />
Dimension Props
| Prop | Type | Default | Description |
|---|---|---|---|
width |
'sm' | 'md' | 'lg' | 'full' |
'md' |
Card width (280px, 358px, 420px, 100%) |
height |
'sm' | 'md' | 'lg' | 'auto' |
'md' |
Card height (100px, 130px, 160px, auto) |
radius |
'none' | 'sm' | 'md' | 'lg' | 'full' |
'md' |
Border radius (0px, 8px, 14px, 20px, 9999px) |
padding |
'sm' | 'md' | 'lg' | 'xl' |
'md' |
Inner padding (12px, 16px, 20px, 24px) |
Color Props
| Prop | Type | Default | Description |
|---|---|---|---|
bgColor |
'cyan' | 'green' | 'yellow' | 'red'
|
'cyan' |
Card background color (4 approved colors only) |
iconColor |
'blue' | 'green' | 'yellow' | 'red'
|
'blue' |
Icon button background |
activeColor |
'blue' | 'green' | 'yellow' | 'red'
|
'blue' |
Active status text color |
titleColor |
'dark' | 'gray' | 'light' | 'black' |
'dark' |
Title text color |
valueColor |
'dark' | 'blue' | 'gray' | 'black' |
'dark' |
Value text color |
Background Colors
Only 4 approved background colors are available:
<WbStatsCard bgColor="cyan" ... /> {/* #0C9CFC1A */}
<WbStatsCard bgColor="green" ... /> {/* #0CC7901A */}
<WbStatsCard bgColor="yellow" ... /> {/* #FFCE0B1A */}
<WbStatsCard bgColor="red" ... /> {/* #E103031A */}
Icon Props
| Prop | Type | Default | Description |
|---|---|---|---|
icon |
ReactNode |
<WbIconDownload /> |
Icon element (see Available Icons below) |
showIcon |
boolean |
true |
Show/hide icon button |
iconSize |
'sm' | 'md' | 'lg' |
'md' |
Icon button size (32px, 42px, 48px) |
iconRadius |
'none' | 'sm' | 'md' | 'lg' | 'full' |
'sm' |
Icon button border radius |
iconSvgSize |
'xs' | 'sm' | 'md' | 'lg' | 'xl' |
'md' |
Inner icon SVG size (14px, 18px, 20px, 24px, 28px) |
onIconClick |
() => void |
undefined |
Icon button click handler |
Custom Colors Example
<!-- Green theme -->
<WbStatsCard
title="Tasks"
value={45}
activeCount={40}
inactiveCount={5}
bgColor="green"
iconColor="green"
activeColor="green"
activeLabel="completed"
inactiveLabel="pending"
icon={<WbIconCheck />}
/>
<!-- Yellow theme -->
<WbStatsCard
title="In Progress"
value={129}
activeCount={17}
inactiveCount={2}
bgColor="yellow"
iconColor="yellow"
activeColor="yellow"
icon={<WbIconClock />}
/>
Popup Component
Modal dialog for confirmations, forms, and alerts with backdrop overlay.
Props API
| Prop | Type | Default | Description |
|---|---|---|---|
isOpen |
boolean |
Required | Controls popup visibility |
onClose |
() => void |
undefined |
Called when backdrop or close button clicked |
showCloseButton |
boolean |
false |
Show X button in top-right corner |
title |
string |
undefined |
Popup title text |
description |
string |
undefined |
Popup description text |
paddingSize |
'small' | 'large' |
'large' |
Inner padding size |
children |
ReactNode |
undefined |
Custom content |
Example 1: Simple Modal Popup
The simplest way to use WbPopup is by controlling its visibility
with a boolean state. Set isOpen to
true to show the popup, and false to hide
it.
Title
Keep your messages short, but make sure they cover everything you need to say.
import { useState } from 'react';
import { WbPopup } from 'works-buddy;
function SimplePopupExample() {
// Step 1: Create state to control popup visibility
const [isOpen, setIsOpen] = useState(false);
// Step 2: Render the popup with isOpen and onClose
return (
<WbPopup
isOpen={isOpen}
onClose={() => setIsOpen(false)}
showCloseButton
title="Title"
description="Keep your messages short, but make sure they cover everything you need to say."
primaryButtonLabel="Button"
onPrimaryClick={() => {
// Handle primary action
setIsOpen(false);
}}
secondaryButtonLabel="Button"
onSecondaryClick={() => setIsOpen(false)}
/>
);
}
Example 2: Open Popup with WbButton
A common pattern is to open the popup when a user clicks a button.
Simply call setIsOpen(true) in the button's
onClick handler.
Click the button below to see it in action.
Title
Keep your messages short, but make sure they cover everything you need to say.
import { useState } from 'react';
import { WbPopup, WbButton } from 'works-buddy;
function ButtonTriggeredPopup() {
const [isOpen, setIsOpen] = useState(false);
return (
<div>
{/* Button that opens the popup */}
<WbButton
variant="fill"
onClick={() => setIsOpen(true)}
>
Open Modal
</WbButton>
{/* Popup that appears when button is clicked */}
<WbPopup
isOpen={isOpen}
onClose={() => setIsOpen(false)}
showCloseButton
title="Title"
description="Keep your messages short, but make sure they cover everything you need to say."
primaryButtonLabel="Button"
onPrimaryClick={() => {
// Handle primary action
setIsOpen(false);
}}
secondaryButtonLabel="Button"
onSecondaryClick={() => setIsOpen(false)}
/>
</div>
);
}
Button Props
| Prop | Type | Description |
|---|---|---|
primaryButtonLabel |
string |
Primary button text (purple filled) |
onPrimaryClick |
() => void |
Primary button click handler |
secondaryButtonLabel |
string |
Secondary button text (outlined) |
onSecondaryClick |
() => void |
Secondary button click handler |
Input Props
| Prop | Type | Description |
|---|---|---|
inputPlaceholder |
string |
Input field placeholder text |
inputValue |
string |
Controlled input value |
onInputChange |
(e: ChangeEvent) => void |
Input change handler |
With Input Field
Enter Name
<WbPopup
isOpen={isOpen}
onClose={() => setIsOpen(false)}
title="Enter Name"
inputPlaceholder="Enter name..."
inputValue={name}
onInputChange={(e) => setName(e.target.value)}
primaryButtonLabel="Save"
onPrimaryClick={handleSave}
/>
Simple Alert
Success!
Changes saved.
<WbPopup
isOpen={isOpen}
onClose={() => setIsOpen(false)}
title="Success!"
description="Your changes have been saved."
primaryButtonLabel="OK"
onPrimaryClick={() => setIsOpen(false)}
paddingSize="small"
/>
With Custom Content
<WbPopup
isOpen={isOpen}
onClose={() => setIsOpen(false)}
showCloseButton
title="Custom Content"
>
<div>
<p>Any custom React content here</p>
<MyCustomComponent />
</div>
</WbPopup>
Avatar Component
Display user profile images or initials with optional status indicators.
Props API
| Prop | Type | Default | Description |
|---|---|---|---|
src |
string |
undefined |
Image URL |
alt |
string |
'Avatar' |
Alt text for image |
name |
string |
undefined |
Name for fallback initial |
size |
'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl' |
'4xl'
|
'md' |
Avatar size |
status |
'online' | 'offline' | 'away' | 'busy' | 'none'
|
'none' |
Status indicator |
With Image
<WbAvatar
src="https://example.com/avatar.png"
alt="John Doe"
size="md"
/>
With Initials (Fallback)
<WbAvatar name="John Doe" size="md" />
Sizes
<WbAvatar name="Alice" size="xs" />
<WbAvatar name="Alice" size="sm" />
<WbAvatar name="Alice" size="md" />
<WbAvatar name="Alice" size="lg" />
<WbAvatar name="Alice" size="xl" />
<WbAvatar name="Alice" size="2xl" />
<WbAvatar name="Alice" size="3xl" />
<WbAvatar name="Alice" size="4xl" />
Status Indicators
<WbAvatar name="John" size="lg" status="online" />
<WbAvatar name="John" size="lg" status="offline" />
<WbAvatar name="John" size="lg" status="away" />
<WbAvatar name="John" size="lg" status="busy" />
Size Reference
| Size | Pixels |
|---|---|
xs |
24px |
sm |
32px |
md |
40px |
lg |
48px |
xl |
56px |
2xl |
64px |
3xl |
80px |
4xl |
96px |
Status Colors
| Status | Color |
|---|---|
online |
#22c55e (green) |
offline |
#9ca3af (gray) |
away |
#facc15 (yellow) |
busy |
#ef4444 (red) |
Toggle Component
Switch control for toggling between on and off states.
Props API
| Prop | Type | Default | Description |
|---|---|---|---|
checked |
boolean |
false |
Whether toggle is on |
onChange |
(checked: boolean) => void |
undefined |
Change handler |
label |
string |
undefined |
Label text |
labelPosition |
'left' | 'right' |
'right' |
Label position |
status |
'default' | 'hover' | 'focus' | 'disabled' |
'default' |
Toggle status |
Basic Usage
<WbToggle />
<WbToggle checked={true} />
With Label
<WbToggle label="Enable notifications" />
Label Position
<WbToggle label="Left label" labelPosition="left" />
<WbToggle label="Right label" labelPosition="right" />
States
<WbToggle checked={false} />
<WbToggle checked={true} />
<WbToggle status="disabled" />
Controlled Usage
const [isEnabled, setIsEnabled] = useState(false);
<WbToggle
checked={isEnabled}
onChange={(checked) => setIsEnabled(checked)}
label="Dark mode"
/>
Stepper Component
Numeric input control with increment and decrement buttons. A compact two-button stepper that supports controlled/uncontrolled modes, min/max boundaries, and multiple size variants.
Props API
| Prop | Type | Default | Description |
|---|---|---|---|
value |
number |
0 |
Current value |
min |
number |
-Infinity |
Minimum value |
max |
number |
Infinity |
Maximum value |
step |
number |
1 |
Step increment |
size |
'medium' | 'small' |
'medium' |
Stepper size |
disabled |
boolean |
false |
Disabled state |
onChange |
(value: number) => void |
undefined |
Callback when value changes |
onSelect |
(button: 'decrement' | 'increment' | null) => void
|
undefined |
Callback when a button is selected |
onDecrement |
() => void |
undefined |
Callback when decrement button is clicked |
onIncrement |
() => void |
undefined |
Callback when increment button is clicked |
States
The stepper supports four visual states. Clicking a button highlights it with the active (purple) state.
// Default
<WbStepper />
// Hover state (demo only)
<WbStepper status="hover" activeButton="decrement" />
// Active state (demo only)
<WbStepper status="active" activeButton="increment" />
// Disabled
<WbStepper disabled />
Basic Usage
const [value, setValue] = useState(0);
<WbStepper
value={value}
onChange={(val) => setValue(val)}
/>
Sizes
<WbStepper size="medium" />
<WbStepper size="small" />
With Min/Max
<WbStepper
value={quantity}
min={0}
max={10}
onChange={(val) => setQuantity(val)}
/>
Disabled
<WbStepper disabled />
Pagination Component
Navigate between pages with numbered or dot-based pagination.
Props API
| Prop | Type | Default | Description |
|---|---|---|---|
platform |
'dashboard' | 'website' |
'dashboard' |
Dashboard shows numbers, website shows dots |
currentPage |
number |
1 |
Current active page (1-indexed) |
totalPages |
number |
4 |
Total number of pages |
disabled |
boolean |
false |
Disabled state |
onChange |
(page: number) => void |
undefined |
Page change handler |
Dashboard Style (Numbers)
const [page, setPage] = useState();
<WbPagination
platform="dashboard"
currentPage={page}
totalPages={4}
onChange={(page) => setPage(page)}
/>
Website Style (Dots)
const [page, setPage] = useState();
<WbPagination
platform="website"
currentPage={page}
totalPages={4}
onChange={(page) => setPage(page)}
/>
Dropdown Component
Select dropdown with multi-select support.
Props API
| Prop | Type | Default | Description |
|---|---|---|---|
options |
{ value: string, label: string, disabled?: boolean
}[]
|
Required | Dropdown options |
value |
string[] |
[] |
Selected values (multi-select) |
placeholder |
string |
'Text' |
Placeholder text |
width |
113 | 136 | 192 | 234 | 283 | 353 |
353 |
Dropdown width in pixels |
height |
number |
37 |
Trigger height in pixels |
disabled |
boolean |
false |
Disabled state |
onChange |
(values: string[]) => void |
undefined |
Selection change handler |
Basic Usage
- Option 1 ✓
- Option 2
- Option 3
const [selected, setSelected] = useState();
const options = [
{ value: '1', label: 'Option 1' },
{ value: '2', label: 'Option 2' },
{ value: '3', label: 'Option 3' },
];
<WbDropdown
options={options}
value={selected}
placeholder="Select option"
onChange={(values) => setSelected(values)}
/>
Disabled State
Use the disabled prop to disable the dropdown. The
dropdown cannot be opened or interacted with when disabled.
const [selected, setSelected] = useState();
const options = [
{ value: '1', label: 'Option 1' },
{ value: '2', label: 'Option 2' },
{ value: '3', label: 'Option 3' },
];
<WbDropdown
options={options}
value={selected}
placeholder="Select option"
disabled={true}
/>
With Disabled Options
Individual options can be disabled by setting
disabled: true on the option object. Disabled options
are visible but cannot be selected.
- Option 1
- Option 2 (Unavailable)
- Option 3
const options = [
{ value: '1', label: 'Option 1' },
{ value: '2', label: 'Option 2 (Unavailable)', disabled: true },
{ value: '3', label: 'Option 3' },
];
<WbDropdown
options={options}
placeholder="Select option"
onChange={(values) => setSelected(values)}
/>
Controlled Component Example
Here's a complete example showing how to use the dropdown as a controlled component with React state.
import { useState } from 'react';
import { WbDropdown } from 'works-buddy;
function CategoryFilter() {
const [selectedCategories, setSelectedCategories] = useState<string[]>([]);
const categoryOptions = [
{ value: 'electronics', label: 'Electronics' },
{ value: 'clothing', label: 'Clothing' },
{ value: 'books', label: 'Books' },
{ value: 'home', label: 'Home & Garden' },
{ value: 'sports', label: 'Sports', disabled: true },
];
const handleChange = (values: string[]) => {
setSelectedCategories(values);
console.log('Selected categories:', values);
};
return (
<div>
<label>Filter by Category</label>
<WbDropdown
options={categoryOptions}
value={selectedCategories}
placeholder="Select categories"
width={283}
onChange={handleChange}
/>
{selectedCategories.length > 0 && (
<p>Selected: {selectedCategories.join(', ')}</p>
)}
</div>
);
}
Width Options
| Width | Pixels |
|---|---|
113 |
113px |
136 |
136px |
192 |
192px |
234 |
234px |
283 |
283px |
353 |
353px (default) |
Shadow Utilities
CSS utility classes for applying consistent shadow effects.
Usage
WbShadow provides CSS classes to apply box shadows. Import the CSS and add classes to any element.
<div className="wbshadow-blur-4">Light shadow</div>
<div className="wbshadow-blur-25">Medium shadow</div>
<div className="wbshadow-blur-45">Heavy shadow</div>
Available Classes
Class Reference
| Class | Blur | Box Shadow |
|---|---|---|
wbshadow-blur-4 |
4px | 0 0 4px rgba(115, 93, 255, 0.25) |
wbshadow-blur-8 |
8px | 0 0 8px rgba(115, 93, 255, 0.25) |
wbshadow-blur-12 |
12px | 0 0 12px rgba(115, 93, 255, 0.25) |
wbshadow-blur-25 |
25px | 0 0 25px rgba(115, 93, 255, 0.25) |
wbshadow-blur-35 |
35px | 0 0 35px rgba(115, 93, 255, 0.25) |
wbshadow-blur-45 |
45px | 0 0 45px rgba(115, 93, 255, 0.25) |
All shadows use the brand purple color (#735DFF) at 25% opacity.
Select Component
Single-select dropdown with status variants and multiple width options.
Props API
| Prop | Type | Default | Description |
|---|---|---|---|
options |
{ value: string, label: string }[] |
Required | Select options |
value |
string |
undefined |
Selected value |
placeholder |
string |
'Select' |
Placeholder text |
status |
'default' | 'success' | 'info' | 'warning' | 'error'
|
'default' |
Visual status variant |
width |
'xs' | 'sm' | 'md' | 'lg' | 'xl' |
'md' |
Select width |
disabled |
boolean |
false |
Disabled state |
onChange |
(value: string) => void |
undefined |
Selection change handler |
Basic Usage
- Option 1
- Option 2
- Option 3
const [selected, setSelected] = useState("");
const options = [
{ value: '1', label: 'Option 1' },
{ value: '2', label: 'Option 2' },
{ value: '3', label: 'Option 3' },
];
<WbSelect
options={options}
value={selected}
placeholder="Select option"
onChange={(value) => setSelected(value)}
/>
Status Variants
<WbSelect status="default" options={options} />
<WbSelect status="success" options={options} />
<WbSelect status="error" options={options} />
<WbSelect status="warning" options={options} />
<WbSelect status="info" options={options} />
Width Options
| Width | Pixels |
|---|---|
xs |
203px |
sm |
270px |
md |
353px (default) |
lg |
416px |
xl |
494px |
<WbSelect width="xs" options={options} />
<WbSelect width="sm" options={options} />
<WbSelect width="md" options={options} />
<WbSelect width="lg" options={options} />
<WbSelect width="xl" options={options} />
AuthForm Component
Complete authentication form with login/signup fields, social providers, and customizable layout.
Props API
| Prop | Type | Default | Description |
|---|---|---|---|
title |
string |
Required | Form title |
subtitle |
string |
undefined |
Form subtitle |
icon |
ReactNode |
undefined |
Icon displayed at top |
fields |
AuthField[] |
Required | Form input fields |
submitButtonLabel |
string |
Required | Submit button text |
onSubmit |
(e: FormEvent) => void |
undefined |
Form submit handler |
AuthField Type
| Property | Type | Description |
|---|---|---|
name |
string |
Field name (required) |
label |
string |
Field label (required) |
type |
'text' | 'email' | 'password' |
Input type (required) |
placeholder |
string |
Placeholder text |
value |
string |
Field value |
onChange |
(e: ChangeEvent) => void |
Change handler |
rightLink |
{ text: string, onClick: () => void } |
Link next to label (e.g., "Forgot password?") |
Sign In Form
Sign In
Welcome back Adarsh Singh!
Dont have an account?
import { useState } from 'react';
import { WbAuthForm, WbIconUser, WbIconGoogle, WbIconFacebook, WbIconTwitter } from 'works-buddy';
import 'works-buddy/style';
export default function SignInForm() {
const [username, setUsername] = useState('[email protected]');
const [password, setPassword] = useState('');
const [remember, setRemember] = useState(false);
return (
<WbAuthForm
icon={<WbIconUser />}
title="Sign In"
subtitle="Welcome back Adarsh Singh!"
fields={[
{
name: 'username',
label: 'User Name',
type: 'email',
value: username,
onChange: (e) => setUsername(e.target.value),
},
{
name: 'password',
label: 'Password',
type: 'password',
value: password,
onChange: (e) => setPassword(e.target.value),
rightLink: {
text: 'Forgot password?',
onClick: () => alert('Navigate to forgot password'),
},
},
]}
showRememberPassword
rememberPasswordChecked={remember}
onRememberPasswordChange={setRemember}
showSocialLogin
socialProviders={[
{ icon: <WbIconGoogle />, onClick: () => alert('Google'), ariaLabel: 'Google' },
{ icon: <WbIconFacebook />, onClick: () => alert('Facebook'), ariaLabel: 'Facebook' },
{ icon: <WbIconTwitter />, onClick: () => alert('Twitter'), ariaLabel: 'Twitter' },
]}
submitButtonLabel="Sign in"
onSubmit={(e) => {
e.preventDefault();
alert('Sign in: ' + username);
}}
footerText="Dont have an account?"
footerLinkText="Sign Up"
onFooterLinkClick={() => alert('Navigate to sign up')}
/>
);
}
Additional Props
| Prop | Type | Description |
|---|---|---|
showRememberPassword |
boolean |
Show "Remember Password" checkbox |
rememberPasswordChecked |
boolean |
Checkbox checked state |
onRememberPasswordChange |
(checked: boolean) => void |
Checkbox change handler |
showSocialLogin |
boolean |
Show social login section |
socialDividerText |
string |
Divider text (default: "Or with") |
socialProviders |
SocialProvider[] |
Social login buttons |
footerText |
string |
Footer text |
footerLinkText |
string |
Footer link text |
onFooterLinkClick |
() => void |
Footer link click handler |
Sign Up Form
Sign up
Join us by creating a free account !
Dont have an account?
import { useState } from 'react';
import { WbAuthForm, WbIconUserPlus, WbIconGoogle, WbIconFacebook, WbIconTwitter } from 'works-buddy';
import 'works-buddy/style';
export default function SignUpForm() {
const [fullName, setFullName] = useState('Adarsh Singh');
const [password, setPassword] = useState('');
const [confirmPassword, setConfirmPassword] = useState('');
return (
<WbAuthForm
icon={<WbIconUserPlus />}
title="Sign up"
subtitle="Join us by creating a free account !"
fields={[
{
name: 'fullName',
label: 'Full Name',
type: 'text',
value: fullName,
onChange: (e) => setFullName(e.target.value),
},
{
name: 'password',
label: 'Password',
type: 'password',
value: password,
onChange: (e) => setPassword(e.target.value),
},
{
name: 'confirmPassword',
label: 'Confirm Password',
type: 'password',
value: confirmPassword,
onChange: (e) => setConfirmPassword(e.target.value),
},
]}
showSocialLogin
socialProviders={[
{ icon: <WbIconGoogle />, onClick: () => alert('Google'), ariaLabel: 'Google' },
{ icon: <WbIconFacebook />, onClick: () => alert('Facebook'), ariaLabel: 'Facebook' },
{ icon: <WbIconTwitter />, onClick: () => alert('Twitter'), ariaLabel: 'Twitter' },
]}
submitButtonLabel="Create Account"
onSubmit={(e) => {
e.preventDefault();
if (password !== confirmPassword) {
alert('Passwords do not match!');
return;
}
alert('Account created for: ' + fullName);
}}
footerText="Dont have an account?"
footerLinkText="Sign in"
onFooterLinkClick={() => alert('Navigate to sign in')}
/>
);
}
Forgot Password Form
Forgot Password
Hello Adarsh Singh!
import { useState } from 'react';
import { WbAuthForm, WbIconChat } from 'works-buddy';
import 'works-buddy/style';
export default function ForgotPasswordForm() {
const [newPassword, setNewPassword] = useState('');
const [confirmPassword, setConfirmPassword] = useState('');
const [remember, setRemember] = useState(false);
return (
<WbAuthForm
icon={<WbIconChat />}
title="Forgot Password"
subtitle="Hello Adarsh Singh!"
fields={[
{
name: 'newPassword',
label: 'New Password',
type: 'password',
value: newPassword,
onChange: (e) => setNewPassword(e.target.value),
},
{
name: 'confirmPassword',
label: 'Confirm Password',
type: 'password',
value: confirmPassword,
onChange: (e) => setConfirmPassword(e.target.value),
},
]}
showRememberPassword
rememberPasswordChecked={remember}
onRememberPasswordChange={setRemember}
submitButtonLabel="Continue"
onSubmit={(e) => {
e.preventDefault();
if (newPassword !== confirmPassword) {
alert('Passwords do not match!');
return;
}
alert('Password reset successful!');
}}
/>
);
}
Complete Example — All Three Forms
A single copy-paste runnable file with Sign In, Sign Up, and Forgot Password. No external libraries, routing, or icon packages needed.
import { useState } from 'react';
import {
WbAuthForm,
WbIconUser,
WbIconUserPlus,
WbIconChat,
WbIconGoogle,
WbIconFacebook,
WbIconTwitter,
} from 'works-buddy';
import 'works-buddy/style';
/* ── Shared social-provider list ── */
const socialProviders = [
{ icon: <WbIconGoogle />, onClick: () => alert('Google'), ariaLabel: 'Google' },
{ icon: <WbIconFacebook />, onClick: () => alert('Facebook'), ariaLabel: 'Facebook' },
{ icon: <WbIconTwitter />, onClick: () => alert('Twitter'), ariaLabel: 'Twitter' },
];
/* ── Page type ── */
type Page = 'signin' | 'signup' | 'forgot';
/* ── Main component ── */
export default function AuthExample() {
const [page, setPage] = useState<Page>('signin');
// Sign In state
const [username, setUsername] = useState('[email protected]');
const [signInPassword, setSignInPassword] = useState('');
const [remember, setRemember] = useState(false);
// Sign Up state
const [fullName, setFullName] = useState('Adarsh Singh');
const [signUpPassword, setSignUpPassword] = useState('');
const [signUpConfirm, setSignUpConfirm] = useState('');
// Forgot Password state
const [newPassword, setNewPassword] = useState('');
const [forgotConfirm, setForgotConfirm] = useState('');
const [forgotRemember, setForgotRemember] = useState(false);
if (page === 'signin') {
return (
<WbAuthForm
icon={<WbIconUser />}
title="Sign In"
subtitle="Welcome back Adarsh Singh!"
fields={[
{
name: 'username',
label: 'User Name',
type: 'email',
value: username,
onChange: (e) => setUsername(e.target.value),
},
{
name: 'password',
label: 'Password',
type: 'password',
value: signInPassword,
onChange: (e) => setSignInPassword(e.target.value),
rightLink: {
text: 'Forgot password?',
onClick: () => setPage('forgot'),
},
},
]}
showRememberPassword
rememberPasswordChecked={remember}
onRememberPasswordChange={setRemember}
showSocialLogin
socialProviders={socialProviders}
submitButtonLabel="Sign in"
onSubmit={(e) => {
e.preventDefault();
alert('Sign in: ' + username);
}}
footerText="Dont have an account?"
footerLinkText="Sign Up"
onFooterLinkClick={() => setPage('signup')}
/>
);
}
if (page === 'signup') {
return (
<WbAuthForm
icon={<WbIconUserPlus />}
title="Sign up"
subtitle="Join us by creating a free account !"
fields={[
{
name: 'fullName',
label: 'Full Name',
type: 'text',
value: fullName,
onChange: (e) => setFullName(e.target.value),
},
{
name: 'password',
label: 'Password',
type: 'password',
value: signUpPassword,
onChange: (e) => setSignUpPassword(e.target.value),
},
{
name: 'confirmPassword',
label: 'Confirm Password',
type: 'password',
value: signUpConfirm,
onChange: (e) => setSignUpConfirm(e.target.value),
},
]}
showSocialLogin
socialProviders={socialProviders}
submitButtonLabel="Create Account"
onSubmit={(e) => {
e.preventDefault();
if (signUpPassword !== signUpConfirm) {
alert('Passwords do not match!');
return;
}
alert('Account created for: ' + fullName);
}}
footerText="Dont have an account?"
footerLinkText="Sign in"
onFooterLinkClick={() => setPage('signin')}
/>
);
}
// page === 'forgot'
return (
<WbAuthForm
icon={<WbIconChat />}
title="Forgot Password"
subtitle="Hello Adarsh Singh!"
fields={[
{
name: 'newPassword',
label: 'New Password',
type: 'password',
value: newPassword,
onChange: (e) => setNewPassword(e.target.value),
},
{
name: 'confirmPassword',
label: 'Confirm Password',
type: 'password',
value: forgotConfirm,
onChange: (e) => setForgotConfirm(e.target.value),
},
]}
showRememberPassword
rememberPasswordChecked={forgotRemember}
onRememberPasswordChange={setForgotRemember}
submitButtonLabel="Continue"
onSubmit={(e) => {
e.preventDefault();
if (newPassword !== forgotConfirm) {
alert('Passwords do not match!');
return;
}
alert('Password reset successful!');
setPage('signin');
}}
/>
);
}
Changelog
Version history and release notes for WorksBuddy.
v0.2.0 (Current)
Component Library Expansion - February 2026
- ✨ Input component with validation states
- ✨ Select component with single and multi-select
- ✨ Dropdown component with checkbox options
- ✨ Checkbox component with indeterminate state
- ✨ Radio button component
- ✨ Toggle/Switch component
- ✨ Tabs component
- ✨ Stepper component
- ✨ Pagination component
- ✨ Popup/Modal component
- ✨ Avatar component with fallback support
- ✨ Badge component with variants
- ✨ Alert component
- ✨ DataTable component
- ✨ AuthForm component
- ✨ Typography system
- ✨ Card component
- ✨ Progress bar component
- ✨ Navigation components (Top Nav, Bottom Nav)
- ✨ Dashboard layout component
- 📚 Interactive documentation with live examples
v0.1.0
Initial Release - January 2025
- ✨ Button component with fill, stroke, and text variants
- ✨ All 5 sizes: giant, large, medium, small, tiny
- ✨ Full keyboard accessibility support
- ✨ CSS variable theming system
- ✨ Comprehensive design tokens
- ✨ TypeScript support
- 📚 Complete documentation
Upcoming
- Date picker component
- Time picker component
- File upload component
- Toast/Notification component
- Accordion component
- Breadcrumb component
- Additional color themes
Support & Feedback
Get help using WorksBuddy or share feedback to help us improve.
Documentation
Most questions are answered in this documentation. Use the sidebar navigation to find specific topics.
GitHub Issues
Report bugs or request features on GitHub:
Common Issues
Styles not applying
Problem: WorksBuddy components appear unstyled.
Solution: Ensure you imported the CSS file:
import 'works-buddy/style';
Type errors
Problem: TypeScript errors when using components.
Solution: Ensure you have the correct React version (18+) and TypeScript is configured properly.
Focus outline not visible
Problem: Focus outline is not showing on buttons.
Solution: Check that you imported the CSS and no global styles are overriding the focus outline.
Getting Help
When reporting issues, include:
- Minimal code example
- WorksBuddy version
- React version
- Browser and OS
- Expected vs actual behavior