Contributing Guidelines
Learn how to contribute to Vera UI development
Contributing to Vera UI
We welcome contributions to Vera UI! This guide will help you get started with contributing to the project.
Development Setup
Fork and Clone
Fork the repository on GitHub and clone it locally:
git clone https://github.com/helgadigitals-limited-company/vera-ui.git
cd vera-uiInstall Dependencies
pnpm install
We use pnpm for package management:
```bash
pnpm installDevelopment Workflow
The project is organized as a monorepo with two main packages:
packages/ui: The component librarypackages/docs: This documentation site
Run both in development:
# Start both UI development and docs
pnpm dev
# Or run individually
pnpm dev:ui # Component library development
pnpm dev:docs # Documentation siteBuild and Test
# Build the component library
pnpm build:ui
# Build the documentation
pnpm build:docs
# Run tests
pnpm test
# Lint code
pnpm lintProject Structure
vera-ui/
├── packages/
│ ├── ui/ # Component library
│ │ ├── src/
│ │ │ ├── components/ # React components
│ │ │ │ ├── ui/ # Base UI components
│ │ │ │ └── ... # Complex components
│ │ │ ├── hooks/ # Custom hooks
│ │ │ ├── lib/ # Utilities
│ │ │ └── index.ts # Main export
│ │ └── package.json
│ └── docs/ # Documentation site
│ ├── content/ # MDX documentation
│ ├── app/ # Next.js app
│ └── package.json
├── pnpm-workspace.yaml
└── package.jsonComponent Development Guidelines
Component Architecture
All components should follow these principles:
Accessibility First: Every component must be accessible by default with proper ARIA attributes, keyboard navigation, and screen reader support.
- Built with Radix UI: Use Radix UI primitives when available
- Customizable: Support className overrides and style customization
- TypeScript: Full TypeScript support with proper type definitions
- Composable: Components should be composable and follow compound component patterns
- Responsive: Work well across different screen sizes
Component Template
Here's a template for creating new components:
"use client"
import * as React from "react"
import { cva, type VariantProps } from "class-variance-authority"
import { cn } from "@/lib/utils"
const myComponentVariants = cva(
"base-classes-here",
{
variants: {
variant: {
default: "default-variant-classes",
secondary: "secondary-variant-classes",
},
size: {
default: "default-size-classes",
sm: "small-size-classes",
lg: "large-size-classes",
},
},
defaultVariants: {
variant: "default",
size: "default",
},
}
)
export interface MyComponentProps
extends React.HTMLAttributes<HTMLDivElement>,
VariantProps<typeof myComponentVariants> {
// Additional props here
}
const MyComponent = React.forwardRef<HTMLDivElement, MyComponentProps>(
({ className, variant, size, ...props }, ref) => {
return (
<div
className={cn(myComponentVariants({ variant, size, className }))}
ref={ref}
{...props}
/>
)
}
)
MyComponent.displayName = "MyComponent"
export { MyComponent, myComponentVariants }Component Categories
Organize components into these categories:
Forms
- Input, Textarea, Select, Checkbox, Radio, etc.
- Form validation and handling components
Navigation
- Breadcrumb, Navigation Menu, Tabs, Sidebar, etc.
- Components for site navigation
Data Display
- Table, Badge, Avatar, Card, etc.
- Components for displaying information
Layout
- Container, Grid, Stack, Separator, etc.
- Components for page layout
Feedback
- Alert, Toast, Progress, Loading, etc.
- Components for user feedback
Overlays
- Dialog, Sheet, Popover, Tooltip, etc.
- Components that appear above other content
Documentation Guidelines
Component Documentation
Every component should have comprehensive documentation including:
- Overview: What the component does and when to use it
- Installation: Import statement and dependencies
- Basic Usage: Simple example
- Props: All available props with types and descriptions
- Variants: Different visual styles available
- Examples: Multiple real-world use cases
- Accessibility: ARIA patterns and keyboard interactions
- API Reference: Detailed prop documentation
Documentation Template
---
title: Component Name
description: Brief description of what the component does
---
import { ComponentPreview } from "@/components/component-preview"
import { Button } from "@helgadigitals/vera-ui"
# Component Name
Brief overview of the component and its purpose.
## Installation
```bash npm2yarn
npm install @helgadigitals/vera-ui
## Usage
<ComponentPreview>
<Button>Example usage</Button>
</ComponentPreview>
```tsx
import { Button } from "@helgadigitals/vera-ui"
export default function Example() {
return (
<Button>
Example usage
</Button>
)
}
```Examples
Basic Example
[Description and code example]
Advanced Example
[Description and code example]
API Reference
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| variant | "default" | "secondary" | "default" | Visual style variant |
| size | "default" | "sm" | "lg" | "default" | Size of the component |
Accessibility
- Proper ARIA attributes
- Keyboard navigation support
- Screen reader compatibility
## Pull Request Guidelines
### Before Submitting
- [ ] Run tests and ensure they pass
- [ ] Run linting and fix any issues
- [ ] Update documentation for any new features
- [ ] Add examples for new components
- [ ] Follow the established code style
### PR Template
When submitting a pull request, please include:
1. **Description**: Clear description of what the PR does
2. **Type**: Bug fix, new feature, documentation, etc.
3. **Testing**: How you tested the changes
4. **Screenshots**: For UI changes, include before/after screenshots
5. **Breaking Changes**: Any breaking changes and migration path
### Component Checklist
For new components, ensure:
- [ ] Component follows the template structure
- [ ] Includes proper TypeScript types
- [ ] Has comprehensive documentation
- [ ] Includes multiple usage examples
- [ ] Follows accessibility guidelines
- [ ] Works with dark/light themes
- [ ] Is responsive across screen sizes
- [ ] Exports are added to main index.ts
- [ ] Documentation is added to the docs site
## Code Style
We use the following tools for code consistency:
- **ESLint**: For code linting
- **Prettier**: For code formatting (integrated with ESLint)
- **TypeScript**: For type checking
The configuration is already set up in the repository. Make sure to:
1. Use meaningful variable and function names
2. Add comments for complex logic
3. Keep components focused and single-responsibility
4. Use TypeScript properly with good type definitions
## Community
- **GitHub Issues**: Report bugs and request features
- **GitHub Discussions**: Ask questions and share ideas
- **Discord**: Join our community chat (link TBD)
<Callout type="success">
**Thank you for contributing!** Every contribution, no matter how small, helps make Vera UI better for everyone.
</Callout>Installation
Get started with Vera UI, a modern React component library built with accessibility and customization in mind.
Introduction
Essential building blocks for collecting user input and managing form interactions. All form components are built with validation, accessibility, and user experience in mind.