Skip to content

API Reference

Sparkle Design System API


Sparkle Design System API / types/src

Animation scale for durations, easing curves, and transitions


Common API response types

T = unknown


Common component prop types


Border radius scale for consistent corner radius values


Color scale definition for theme colors Supports both named colors and numeric scales (50, 100, 200, etc.)


Common form field props


Extended form field props for advanced form components

name: string

Field name for form submission and validation

optional size: "sm" | "md" | "lg"

Size variant for the field

optional type: "text" | "email" | "password" | "textarea" | "select"

Field type for input elements

optional validationState: "default" | "error" | "success"

Validation state of the field


Form validation message props

optional match: (value, formData) => boolean | Promise<boolean>

Custom validation function

string

FormData

boolean | Promise<boolean>

optional validationType: "valueMissing" | "typeMismatch" | "patternMismatch" | "tooLong" | "tooShort" | "rangeUnderflow" | "rangeOverflow" | "stepMismatch" | "badInput"

Built-in validation type


Common pagination parameters


Shadow scale for box shadows and elevation


Spacing scale for consistent spacing values


Comprehensive theme configuration with design token system Compatible with both Tailwind CSS (web) and React Native StyleSheet (mobile)

animation: AnimationScale

Animation system for durations, easing, and transitions

borderRadius: BorderRadiusScale

Border radius system for consistent corner treatments

colors: ColorScale

Color system with semantic and brand colors Supports nested scales (e.g., primary: { 50: ’#…’, 500: ’#…’ })

shadows: ShadowScale

Shadow system for elevation and depth

spacing: SpacingScale

Spacing scale for margins, padding, gaps, and layout

typography: TypographyScale

Typography system with fonts, sizes, weights, and spacing


Typography scale with font families, sizes, weights, and line heights


Common user types