Skip to content
Components

Components

Components Overview

PrimitiveKit provides 38 production-ready components organized into 6 categories. All components are fully accessible, customizable, and TypeScript-ready.

Quick Navigation

Form Components (10)

Build interactive forms with validation and accessibility:

ComponentDescription
ButtonClickable button with variants and loading states
InputText input with validation and icons
SelectDropdown selection with options
CheckboxCheckbox input with labels
RadioRadio button groups
SwitchToggle switch for boolean values
TextareaMulti-line text input with auto-resize
SliderRange slider for numeric values
FormForm wrapper with validation
UploadFile upload with drag-and-drop

Layout Components (6)

Structure your pages with flexible layouts:

ComponentDescription
CardContent container with variants
ContainerResponsive page container
GridCSS Grid layout system
StackVertical/horizontal stacking
SpaceConsistent spacing between elements
DividerVisual content separator

Feedback Components (5)

Provide user feedback and loading states:

ComponentDescription
AlertAlert messages with status variants
BadgeStatus badges and labels
SpinnerLoading spinner indicator
ProgressProgress bar with animations
SkeletonLoading content placeholder

Navigation Components (6)

Help users navigate your application:

ComponentDescription
LinkStyled link component
BreadcrumbBreadcrumb navigation trail
TabsTab navigation with panels
MenuNavigation menu with nesting
StepsStep indicator for processes
PaginationPage navigation controls

Overlay Components (5)

Display content in overlays and modals:

ComponentDescription
ModalModal dialog with sizes
DrawerSlide-out panel from edges
TooltipHover tooltip with placement
PopoverRich content popover
DropdownDropdown menu with items

Data Display Components (7)

Display data and content effectively:

ComponentDescription
AvatarUser avatar with fallbacks
TagRemovable tag labels
TableData table with sorting
CollapseCollapsible content panels
ImageImage with loading states
EmptyEmpty state placeholder
TypographyText and heading components

Component Features

🎨 Fully Customizable

Every component supports extensive CSS variable customization:

  • 50-150+ CSS variables per component
  • Component-level and global customization
  • Design token integration
  • Theme support

♿ Accessibility First

All components follow WCAG 2.1 AA standards:

  • Proper ARIA attributes
  • Keyboard navigation
  • Screen reader support
  • Focus management
  • Touch target sizes (44x44px)

📘 TypeScript Support

Complete TypeScript definitions:

  • Full prop type definitions
  • CSS variable types
  • Event handler types
  • Generic component types

🎯 Design Tokens

Components use 600+ design tokens:

  • Color scales
  • Spacing system
  • Typography scale
  • Shadow system
  • Border radius
  • Animation timing

Getting Started

Installation

npm install @primitivekit/react

Basic Usage

import { Button, Input, Card } from '@primitivekit/react';

function App() {
  return (
    <Card>
      <Input 
        label="Email" 
        type="email"
        placeholder="Enter your email"
      />
      <Button variant="primary" size="large">
        Submit
      </Button>
    </Card>
  );
}

With Design Tokens

import '@primitivekit/react/tokens/tokens.css';
import { Button } from '@primitivekit/react';

function App() {
  return (
    <Button
      style={{
        '--btn-bg-color': 'var(--color-brand-primary-500)',
        '--btn-border-radius': 'var(--border-radius-lg)',
        '--btn-padding-x': 'var(--spacing-4)',
      }}
    >
      Token-based Button
    </Button>
  );
}

Component Patterns

Form Pattern

<Form onSubmit={handleSubmit}>
  <Stack spacing="medium">
    <Input label="Name" required />
    <Input label="Email" type="email" required />
    <Textarea label="Message" rows={5} />
    <Button type="submit">Submit</Button>
  </Stack>
</Form>

Layout Pattern

<Container size="lg">
  <Grid columns={{ base: 1, md: 2, lg: 3 }} gap="large">
    <Card>Content 1</Card>
    <Card>Content 2</Card>
    <Card>Content 3</Card>
  </Grid>
</Container>

Modal Pattern

const [isOpen, setIsOpen] = useState(false);

<>
  <Button onClick={() => setIsOpen(true)}>
    Open Modal
  </Button>
  
  <Modal 
    isOpen={isOpen} 
    onClose={() => setIsOpen(false)}
    title="Modal Title"
    footer={
      <>
        <Button variant="outline" onClick={() => setIsOpen(false)}>
          Cancel
        </Button>
        <Button onClick={handleConfirm}>
          Confirm
        </Button>
      </>
    }
  >
    <p>Modal content</p>
  </Modal>
</>

Next Steps

Support