esniiava

esniiava API Reference

Developer-friendly programmatic access to components, utilities, and hooks with type-safe interfaces.

Components

Base Button Component


// Installation
import { Button } from '@esniiava/core'

// Usage
<Button 
  variant="primary"
  size="lg"
  onClick={handleClick}
>
  Submit
</Button>
                        

Props

variant
string (one of: 'primary', 'neutral', 'outline', 'ghost')
size
string (one of: 'sm', 'md', 'lg')

Icon API


import { Icon } from '@esniiava/icons'

// Basic usage
<Icon 
  name="Settings" 
  className="w-6 h-6" 
/&
gt;

// With theme adaptation
<Icon 
  name="Moon" 
  theme="auto" 
  className="w-5 h-5" 
/&
gt;
                        

Parameters

  • name - Symbol name from @esniiava/icons
  • theme - 'light' | 'dark' | 'auto' (default)

Utilities

Color Utilities


import { getColor, getContrast } from '@esniiava/visuals'

// Get hex value
const primaryHex = getColor('primary')

// Get contrast ratio
const contrast = getContrast('#fff', '#111827')
                        

Theme Manipulation


import { setTheme, getTheme } from '@esniiava/theme'

// Update application theme
setTheme('dark')

// Get current theme
const currentMode = getTheme()
                        

Hooks

useClickOutside


import { useClickOutside } from '@esniiava/hooks'

const Dropdown = () => {
  const [open, setOpen] = useState(false)
  const ref = useClickOutside(() => setOpen(false))

  return (
    <div ref={ref} class="relative">
      <button onClick={() => setOpen(!open)}></button>
      {open && <Menu />}
    </div>
  )
}