Skip to content

Constants

Shared design tokens and configuration values.

Also known as: tokens, design tokens, config, theme values, variables

When to use

  • Use BREAKPOINTS with media query helpers for responsive design.
  • Use COLORS for consistent color palette across your app. For color manipulation, see Colors.
  • Use KEYFRAMES with Emotion for reusable animations.
  • Use KEY_SYMBOLS with getKeySymbols for keyboard shortcut display.

Import

tsx
import { BREAKPOINTS, COLORS, KEYFRAMES, KEY_SYMBOLS } from '@vacano/ui'

All constants are declared with as const for literal type inference.

BREAKPOINTS

Responsive breakpoint values in pixels. Used by mediaUp, mediaDown, mediaBetween.

tsx
import { BREAKPOINTS } from '@vacano/ui'

// BREAKPOINTS.sm   → 640
// BREAKPOINTS.md   → 768
// BREAKPOINTS.lg   → 1024
// BREAKPOINTS.xl   → 1280
// BREAKPOINTS['2xl'] → 1536
KeyValue
sm640
md768
lg1024
xl1280
2xl1536

COLORS

Design system color palette.

tsx
import { COLORS } from '@vacano/ui'

// COLORS.black              → '#212529'
// COLORS.white              → '#ffffff'
// COLORS.red                → '#C1121F'
// COLORS.green              → '#16a34a'
// COLORS.yellow             → '#ffb703'
// COLORS.gray               → '#e5e7eb'
// COLORS['steel-blue']      → '#0582ca'
// COLORS['iron-grey']       → '#495057'
// COLORS['baltic-blue']     → '#1e6091'
KeyValue
black#212529
white#ffffff
red#C1121F
green#16a34a
yellow#ffb703
gray#e5e7eb
steel-blue#0582ca
iron-grey#495057
baltic-blue#1e6091

KEYFRAMES

Reusable Emotion CSS keyframe animations.

tsx
import { KEYFRAMES } from '@vacano/ui'
import { css } from '@emotion/react'

const fadeInStyle = css`
  animation: ${KEYFRAMES.fadeIn} 200ms ease-out;
`

Each value is an Emotion keyframes object (created with keyframes from @emotion/react). Use directly in animation properties within Emotion css or styled calls.

KeyDescriptionCSS transform/opacity
rotateFull 360-degree rotationto { transform: rotate(1turn) }
fadeInFade infrom { opacity: 0 } to { opacity: 1 }
fadeOutFade outfrom { opacity: 1 } to { opacity: 0 }
slideInLeftSlide in from leftfrom { translateX(-100%) } to { translateX(0) }
slideOutLeftSlide out to leftfrom { translateX(0) } to { translateX(-100%) }
slideInRightSlide in from rightfrom { translateX(100%) } to { translateX(0) }
slideOutRightSlide out to rightfrom { translateX(0) } to { translateX(100%) }
slideInTopSlide in from topfrom { translateY(-100%) } to { translateY(0) }
slideOutTopSlide out to topfrom { translateY(0) } to { translateY(-100%) }
slideInBottomSlide in from bottomfrom { translateY(100%) } to { translateY(0) }
slideOutBottomSlide out to bottomfrom { translateY(0) } to { translateY(100%) }
scaleInScale in with fadefrom { opacity: 0; scale(0.95) } to { opacity: 1; scale(1) }
slideInTopFadeSlide in from top with fadefrom { opacity: 0; translateY(-100%) } to { opacity: 1; translateY(0) }
slideOutTopFadeSlide out to top with fadefrom { opacity: 1; translateY(0) } to { opacity: 0; translateY(-100%) }
slideInBottomFadeSlide in from bottom with fadefrom { opacity: 0; translateY(100%) } to { opacity: 1; translateY(0) }
slideOutBottomFadeSlide out to bottom with fadefrom { opacity: 1; translateY(0) } to { opacity: 0; translateY(100%) }

KEY_SYMBOLS

Keyboard key to display symbol mappings. Platform-aware (macOS vs other). Used by getKeySymbols.

tsx
import { KEY_SYMBOLS } from '@vacano/ui'

// KEY_SYMBOLS.Meta    → { mac: '⌘', other: 'Win' }
// KEY_SYMBOLS.Control → { mac: '⌃', other: 'Ctrl' }
// KEY_SYMBOLS.Alt     → { mac: '⌥', other: 'Alt' }
// KEY_SYMBOLS.Shift   → { mac: '⇧', other: '⇧' }

The type is Partial<Record<KeyboardEventKey, { mac: string; other: string }>>. Only the keys listed below have symbol mappings; all other KeyboardEventKey values (letters, digits, function keys, punctuation, numpad) are returned as-is by getKeySymbols.

KeymacOSOtherCategory
MetaWinModifier
ControlCtrlModifier
AltAltModifier
ShiftModifier
ArrowUpNavigation
ArrowDownNavigation
ArrowLeftNavigation
ArrowRightNavigation
HomeNavigation
EndNavigation
PageUpNavigation
PageDownNavigation
' ' (Space)Whitespace
EnterEnterEnterWhitespace
TabWhitespace
BackspaceEditing
DeleteEditing
EscapeEscEscEditing
InsertInsInsEditing
CapsLockSystem
NumLockSystem
  • Colors - Color manipulation utilities
  • Media - Media query helpers using BREAKPOINTS
  • Keyboard - Symbol resolution using KEY_SYMBOLS

Released under the MIT License.