Skip to content

Getting Started

Welcome to the NayaOne Design System

This guide will help you install dependencies, connect the UI libraries, and start using components in your projects.

NayaOne Design System

The package publishes ES2022 JavaScript, and its styles are built with TailwindCSS 4. Both set the minimum supported versions:

  • Chrome 111 or newer
  • Edge 111 or newer
  • Firefox 128 or newer
  • Safari 16.4 or newer, including iOS
  • Node.js 20.19 or newer, or 22.12 or newer

These minimums are hard requirements. Transpiling and polyfilling the package in your own build does not make the styles work in older browsers.

Add NayaOne’s private registry to your package manager with your personal access token.

Terminal window
export NPM_TOKEN=<your-npm-token>
echo //gitlab.com/api/v4/packages/npm/:_authToken=${NPM_TOKEN} > .npmrc

Don’t have one? Generate a new personal access token

Terminal window
bun install @fintech-sandpit/ui
Terminal window
npm install @fintech-sandpit/ui
Terminal window
bun install tailwindcss
Terminal window
npm install tailwindcss

In case of using Vite, add its plugin for TailwindCSS and a configuration file.

Terminal window
bun install @tailwindcss/vite
Terminal window
npm install @tailwindcss/vite

tailwind.config.ts

import type { Config } from 'tailwindcss';
const config: Config = {
darkMode: ['selector', '&:where([data-theme="dark"] *)'],
content: ['./src/**/*.{js,jsx,ts,tsx,vue}'],
};
export default config;

vite.config.ts

import { defineConfig } from 'vite'
import tailwindcss from '@tailwindcss/vite';
import react from '@vitejs/plugin-react'
export default defineConfig({
plugins: [
react(),
tailwindcss(),
],
})

vite.config.ts

import { defineConfig } from 'vite'
import tailwindcss from '@tailwindcss/vite';
import vue from '@vitejs/plugin-vue'
export default defineConfig({
plugins: [
tailwindcss(),
vue(),
],
})

src/main.css

@import "tailwindcss";
@import '@fintech-sandpit/ui';

You can either import the component styles directly in the component file (see below) or in the stylesheet file.

src/main.css

@import "tailwindcss";
@import '@fintech-sandpit/ui';
@import '@fintech-sandpit/ui/style/components/button.css';
@import '@fintech-sandpit/ui/style/components/field.css';
/* ...and so on */

index.html

<!doctype html>
<html lang="en">
<head>
<title></title>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="stylesheet" href="/src/main.css" /> <!-- import the stylesheet file -->
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>

src/component.tsx

// Import the component
import { Button } from '@fintech-sandpit/ui/react';
// Import component styles (optional)
import '@fintech-sandpit/ui/style/components/button.css';
return (
<Button
colorScheme="primary"
variant="outline"
size="lg"
>
Click me
</Button>
);

index.html

<!doctype html>
<html lang="en">
<head>
<title></title>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="stylesheet" href="/src/main.css" /> <!-- import the stylesheet file -->
</head>
<body>
<div id="app"></div>
<script type="module" src="/src/index.ts"></script>
</body>
</html>

src/component.vue

<script setup lang="ts">
// Import the component
import { Button } from '@fintech-sandpit/ui/vue';
// Import component styles (optional)
import '@fintech-sandpit/ui/style/components/button.css';
</script>
<template>
<Button
color-scheme="primary"
variant="outline"
size="lg"
>
Click me
</Button>
</template>