DouglasNeuroInformatics / libui

Generic UI components for DNP projects, built using React and TailwindCSS
https://douglasneuroinformatics.github.io/libui/
Apache License 2.0
2 stars 2 forks source link
Logo

@douglasneuroinformatics/libui

Generic UI components for DNP projects, built using React and TailwindCSS
Explore the docs »

Report Bug · Request Feature

![license](https://img.shields.io/github/license/DouglasNeuroInformatics/libui) ![version](https://img.shields.io/github/package-json/v/DouglasNeuroInformatics/libui) [![codecov](https://codecov.io/gh/DouglasNeuroInformatics/libui/graph/badge.svg?token=t9PkBDS01T)](https://codecov.io/gh/DouglasNeuroInformatics/libui)

About

A React component library built by the Douglas Neuroinformatics Platform (DNP) using shadcn/ui with React and TailwindCSS. Although primarily intended for internal use in our platforms, it is designed as a generic implementation.

Installation

pnpm install @douglasneuroinformatics/libui

Usage

tailwind.config.cjs

const config = require('@douglasneuroinformatics/libui/tailwind/config');

module.exports = config({
  content: ['./index.html', './src/**/*.{js,ts,jsx,tsx}']
});

i18n.ts

import { init } from '@douglasneuroinformatics/libui/i18n';

import common from './common.json';

declare module '@douglasneuroinformatics/libui/i18n' {
  export namespace UserConfig {
    export interface LanguageOptions {
      en: true;
      es: true;
      fr: true;
    }
    export interface Translations {
      common: typeof common;
    }
  }
}

init({ translations: { common } });

main.tsx

import '@douglasneuroinformatics/libui/tailwind/globals.css';
import './i18n';

Contributing

We welcome contributions! If you're interested in improving the library or adding new features, please refer to our contribution guide.

License

Copyright (C) 2024 Douglas Neuroinformatics Platform

This program is free software: you can redistribute it and/or modify it under the terms of the Apache License 2.0.