Skip to main content

Basic Workflow

Relevant source files

Purpose and Scope

This document describes the typical development workflows and patterns used when building user interfaces with @ui8kit/core. It covers common scenarios developers encounter when composing components, applying styling through the variant system, and building standard UI patterns like cards, forms, and layouts. For advanced scenarios where standard components are insufficient (e.g., creating custom form components), see Advanced Workflow. For general guidelines and performance recommendations, see Best Practices. Sources: .devin/wiki.json181-188 src/components/README.md1-259

Component Selection Workflow

The first step in any development workflow is selecting the appropriate component for your use case. The library follows a three-layer hierarchy where each layer serves specific purposes.
Decision matrix: Sources: README.md62-103 src/components/README.md9-19 README.md363-387

Basic Styling Workflow

All components accept variant props instead of className strings. This workflow shows how to apply styling through the variant system.

Step-by-Step: Styling a Component

Step 1: Apply spacing variants
Available spacing values: none, xs, sm, md, lg, xl, 2xl, auto Step 2: Apply color variants
Step 3: Apply visual effects
Step 4: Apply layout variants

Variant Props Reference

Sources: README.md170-217 src/components/README.md206-222

Layout Pattern Workflows

Vertical Stacking with Stack

The most common layout pattern is vertical stacking of elements.
Key Stack props:
  • gap: Space between children (xs, sm, md, lg, xl, 2xl)
  • align: Cross-axis alignment (start, center, end, stretch)
  • justify: Main-axis alignment (start, center, end, between, around)
Sources: src/components/README.md52-64

Horizontal Layout with Group

For horizontal arrangements, use Group.
Sources: src/components/README.md66-78

Grid Layout with Grid

For multi-column layouts, use Grid with responsive presets.
cols preset values:
  • "1-2-3": 1 column mobile, 2 tablet, 3 desktop
  • "2": 2 columns at all breakpoints
  • Custom: Use standard Grid props
Sources: src/components/README.md80-92 README.md90-103

Responsive Container

Use Container for centered, max-width layouts.
Container sizes:
  • xs: 448px
  • sm: 640px
  • md: 768px
  • lg: 1024px
  • xl: 1280px
Sources: src/components/README.md39-50

UI Component Patterns

Working with Cards

Card is a compound component with semantic subcomponents.
Step-by-Step: Building a Card
Sources: src/components/README.md96-117 README.md121-145

Working with Buttons

Button supports variants, sizes, loading states, and icon sections.
Button variants:
  • default: Standard button
  • primary: Primary action
  • secondary: Secondary action
  • destructive: Dangerous actions
  • outline: Outlined style
  • ghost: Minimal style
  • link: Link-styled button
Sources: src/components/README.md119-133

Working with Typography

Use Title for headings and Text for body content.
Title order mapping:
  • order={1}: <h1> tag
  • order={2}: <h2> tag
  • order={3}: <h3> tag
  • (continues to order={6})
Sources: src/components/README.md150-177

Working with Badges

Use Badge for status indicators and labels.
Badge variants:
  • default: Standard badge
  • success: Green/positive
  • warning: Yellow/caution
  • error: Red/negative
  • outline: Outlined style
Sources: src/components/README.md135-148

Semantic HTML Workflow

Use Block with the component prop to render semantic HTML5 elements.
Common semantic elements:
  • section: Thematic grouping
  • article: Self-contained content
  • nav: Navigation links
  • header: Introductory content
  • footer: Footer content
  • aside: Sidebar content
  • main: Main content area
Sources: src/components/README.md23-37 README.md14

Common Development Scenarios

Scenario 1: Building a Feature Card

Sources: README.md310-339 src/components/README.md96-117

Scenario 2: Building a Form Layout

When form-specific components are not available, compose layouts using Block and Box.
Note: For advanced form workflows with custom components, see Advanced Workflow. Sources: README.md310-339 src/components/README.md315-328

Scenario 3: Building a Dashboard Section

Sources: README.md155-168 src/components/README.md80-92

Scenario 4: Responsive Navigation

Sources: src/components/README.md66-78 src/components/README.md39-50

Data Attribute Targeting

All UI components include data-class attributes for semantic targeting in CSS and tests.
CSS targeting example:
Test selector example:
Sources: src/components/README.md223-236

Workflow Summary Table

Sources: src/components/README.md1-259 README.md36-217