Customize
Integrate your style and design system into Lapikit components
By default, Lapikit provides a comprehensive design system inspired by modern UI principles, offering a coherent foundation that can be adapted to the widest possible audience. With Lapikit, you can quickly customize components using a configuration file that you specify in the Vite plugin.
Lapikit uses a Vite plugin to process your configuration. You need to:
Example vite.config.ts:
Default configuration path: src/plugins/lapikit.ts
Lapikit customization is divided into 4 main parts:
Breakpoints configuration manages responsive design behavior across different devices.
Type: {[key: string]: number | string}
Define device-specific breakpoints for responsive behavior. Values should reference threshold keys.
Default values:
Type: {[key: string]: number | string}
Set the actual breakpoint values that correspond to your device keys. These define the pixel widths at which your layout adapts.
Default values:
Theme configuration handles color schemes and theme definitions.
Type: string
Default: "light"
Set the default theme to be used by your application.
Type: boolean
Default: true
Enable or disable automatic color scheme detection based on user preferences.
Type: FragThemes
Define your custom themes with colors and variables. Lapikit provides a comprehensive color system organized by semantic categories.
Color Categories:
Default themes:
Each theme can contain:
boolean): Whether this is a dark theme{[key: string]: {[key: string]: string} | string}): Color definitions organized by semantic categories{[key: string]: string | number}): Custom CSS variables for theme-specific customizationTypography configuration manages font families and text styling.
Type: string
Default: "default"
Set the default typography family to be used.
Type: FragTypography
Define custom font families with support for sans-serif, monospace, and serif font stacks.
Default configuration:
Global styling configuration for design tokens and variables.
Type: FragStyles
Define global styling variables that can be used throughout your application. The styles object supports multiple categories of design tokens.
Type: string
Default: "0.125rem" (2px)
Base spacing unit used throughout the component system.
Type: {[key: string]: string | number}
Border radius values for different component sizes.
Default values:
Type: {[key: string]: string | number}
Maximum width values for dialog components.
Default values:
Type: {[key: string]: string | number}
Maximum width values for modal components.
Default values:
Type: {[key: string]: string | number}
Animation timing and duration values.
Default values:
Complete styles example:
Here’s a complete example of a configuration file (src/plugins/lapikit.ts) with all default values:
Lapikit provides a Vite plugin to automatically process your configuration and generate the necessary CSS files during the build process.
Import:
Usage:
Plugin Options:
The next steps
See also the Breakpoints and Application pages to take full advantage of the visual possibilities.