Skip to content

Upgrade: v0.2.0-beta to v0.3.0-beta

This guide walks you through every change between Velocity v0.2.0-beta and v0.3.0-beta.

v0.2.0-betav0.3.0-beta
Component variantsInline Tailwind classesCVA .variants.ts files
Color tokensDual namespace (--background + --color-background)Single --color-* namespace
Invert themingPer-component colorScheme/variant props.invert-section wrapper class
New dependencyclass-variance-authority
CSS structureMonolithic colors.cssprimitives.css + themes/ directory
UI components1729
Pattern components37

This release includes the following breaking prop changes:

ComponentRemoved PropMigration
ButtoncolorSchemeWrap in <div class="invert-section">
Inputvariant="invert"Wrap in <div class="invert-section">
SelectselectSizeRename to size
TextareatextareaSizeRename to size
  1. Install new dependency

    The component system now uses class-variance-authority for type-safe variant definitions:

    Terminal window
    pnpm add class-variance-authority
  2. Replace colorScheme on Button

    The colorScheme="invert" prop has been removed. Instead, wrap the Button in an .invert-section container:

    <Button colorScheme="invert">Click me</Button>
    <div class="invert-section">
    <Button>Click me</Button>
    </div>
  3. Replace variant="invert" on Input

    Same approach — use the .invert-section wrapper:

    <Input variant="invert" placeholder="Email" />
    <div class="invert-section">
    <Input placeholder="Email" />
    </div>
  4. Rename selectSize to size on Select

    <Select selectSize="sm" />
    <Select size="sm" />
  5. Rename textareaSize to size on Textarea

    <Textarea textareaSize="lg" />
    <Textarea size="lg" />
  6. Update custom CSS token references (optional)

    If you have custom CSS that imports src/styles/tokens/colors.css by path, it still works — the file now imports from primitives.css and themes/. No action required unless you were importing internal token files directly.

    The token architecture now uses a single --color-* namespace. Raw primitives (--background, --foreground, etc.) still exist on :root for backwards compatibility, but component CSS now references --color-background, --color-foreground, etc. exclusively.

Run the full verification suite:

Terminal window
pnpm build && pnpm lint && pnpm check

Also manually verify:

  • Components render correctly in both default and .invert-section contexts
  • Any custom components using old props have been updated
  • Accordion size prop works if you use it (sm, md, lg)
PackageReason
class-variance-authorityType-safe component variant system used by all UI components
ComponentDescription
AccordionCollapsible content sections using native <details>/<summary>
AvatarGroupStacked avatar display with overflow count
PaginationPage navigation with previous/next and page numbers
ProgressDeterminate progress bar with size and color variants
SeparatorHorizontal or vertical divider line
SwitchToggle switch with label support
TableResponsive data table with striped and hoverable variants
ToastNotification toasts with success, error, warning, and info types
CodeBlockSyntax-highlighted code display
DialogModal dialog with backdrop
DropdownDropdown menu trigger
SocialProofLogo/brand display strip
PatternDescription
SearchInputInput with search icon and clear button
PasswordInputInput with show/hide password toggle
StatCardMetric display card with label, value, and trend
EmptyStatePlaceholder for empty content areas with icon and action

Every component now has a co-located .variants.ts file (e.g., button.variants.ts) that defines its visual variants using CVA. This enables:

  • Type-safe props — variant options are derived from the CVA definition
  • Extensibility — import and extend variants in your own components
  • Consistency — all variant logic is co-located, not scattered across templates
// Example: importing and extending button variants
import { buttonVariants, type ButtonVariants } from '@/components/ui';