React Native Glow UI v1 is out now!
Logo
Constants

Styles

Styles for React Native Glow UI

🖌️ Style Constants & Utilities

Glow UI provides a robust, consistent, and themeable design system for React Native. Use these constants and utilities to build beautiful, maintainable UIs with ease.


📏 Spacing System

Predefined spacing values for margin, padding, width, and height.

KeyValue (px)
none0
xs2
sm4
base8
md12
lg16
xl20
2xl24
3xl32
4xl40
5xl48
6xl56
7xl64
8xl80
9xl96
10xl128
import { spacingStyles } from 'src/constants/components/styles';
<View style={{ padding: spacingStyles.lg }} />

🟦 Border Radius System

Easily apply rounded corners with these keys.

KeyValueVisual
none0◻️
xs1🟦
sm2🟩
base4🟪
md6🟫
lg8🟧
xl12🟨
2xl16🟠
3xl24🟣
4xl32🟤
5xl40⚪️
6xl48⚫️
7xl56🔵
8xl64🟡
9xl80🟤
10xl96🟠
full9999🥚
pill500💊
import { borderRadiusStyles } from 'src/constants/components/styles';
<View style={{ borderRadius: borderRadiusStyles.full }} />

🔤 Typography System

Font sizes and weights for consistent text.

Font Sizes

Keypx
xs10
sm12
base14
lg16
xl18
2xl20
3xl24
4xl28
5xl32
6xl36
7xl42
8xl48
9xl56

Font Weights

KeyWeight
thin100
extralight200
light300
normal400
medium500
semibold600
bold700
extrabold800
black900
import { fontSizeStyles, fontWeightStyles } from 'src/constants/components/styles';
<Text style={{ fontSize: fontSizeStyles.lg, fontWeight: fontWeightStyles.bold }} />

🎨 Color System

A palette of named colors for backgrounds, borders, and text.

import { colorStyles } from 'src/constants/components/styles';
<View style={{ backgroundColor: colorStyles['blue-500'] }} />

🌫️ Shadow System

Apply elevation and shadow for depth.

KeyExample
noneNo shadow
xsSubtle
smSmall
baseBase
mdMedium
lgLarge
xlExtra Large
2xlUltra
import { shadowStyles } from 'src/constants/components/styles';
<View style={shadowStyles.lg} />

💧 Opacity System

KeyValue
00
50.05
100.1
200.2
250.25
300.3
400.4
500.5
600.6
700.7
750.75
800.8
900.9
950.95
1001
import { opacityStyles } from 'src/constants/components/styles';
<View style={{ opacity: opacityStyles[50] }} />

➖ Border Width System

KeyValue (px)
none0
xs0.5
sm1
base1.5
md2
lg3
xl4
import { borderWidthStyles } from 'src/constants/components/styles';
<View style={{ borderWidth: borderWidthStyles.lg }} />

🛠️ Utility Functions

Glow UI provides many helpers to generate styles dynamically:

  • generatePadding, generateMargin, generatePaddingX, generatePaddingY, generateMarginX, generateMarginY
  • generateBorderRadius, generateCornerRadius
  • generateTextStyle
  • generateBackgroundColor, generateBorderColor, generateBorder
  • generateFlex, generateFlexDirection, generateJustifyContent, generateAlignItems
  • generatePosition, generateTop, generateBottom, generateLeft, generateRight
  • generateWidth, generateHeight, generateOpacity, generateShadow
  • generateViewStyle (combine multiple configs)

Example

import { generateViewStyle } from 'src/constants/components/styles';

const style = generateViewStyle({
  padding: 'lg',
  backgroundColor: 'blue-100',
  borderRadius: 'xl',
  shadow: 'md',
  opacity: 80,
});

<View style={style} />

See also: