Skip to content
/ core Public

Bright Lab Core contains foundational React UI component libraries for shipping new features faster and it is based on Material UI and will be including some BRIGHT components

Notifications You must be signed in to change notification settings

BRIGHTLAB/core

Folders and files

NameName
Last commit message
Last commit date

Latest commit

fecdbc0 · Oct 25, 2022
May 24, 2022
Jul 25, 2022
Oct 11, 2022
Oct 11, 2022
Oct 10, 2022
Apr 3, 2022
May 1, 2022
Jul 5, 2022
Jun 28, 2022
Mar 30, 2022
Oct 25, 2022
Oct 11, 2022
Jul 26, 2022
Jul 5, 2022

Repository files navigation

Bright Lab logo


Bright Lab Core

Bright Lab Core contains foundational React UI component libraries for shipping new features faster and it is based on Material UI and will be including some BRIGHT components.

npm downloads minizipped size npm latest package

Installation

@bright-lab/core

@bright-lab/core is available as an npm package.

// with npm
npm install @bright-lab/core

// with yarn
yarn add @bright-lab/core

Note: @bright-lab/core is still in alpha. We are adding new components regularly and updating exisitng ones. You're welcome to contribute!

Getting started with @bright-lab/core

Here is an example of a basic app using @bright-lab/core's Form component:

import * as React from 'react';
import { Form } from '@bright-lab/core';

let fields = [
  {
    id: 'full_name',
    name: 'full_name',
    label: 'Full Name',
    type: 'TextField',
    required: true,
    grid: {
      xs: 12,
      md: 6,
    },
  },
  {
    id: 'image_url',
    name: 'image_url',
    label: 'Image',
    type: 'FileUpload',
    required: true,
    grid: {
      xs: 12,
      md: 6,
    },
  },
  {
    id: 'deactivated',
    name: 'deactivated',
    label: 'Deactivated',
    type: 'RadioGroup',
    required: true,
    grid: {
      xs: 12,
      md: 6,
    },
    data: [
      {
        title: 'Yes',
        value: '0',
      },
      {
        title: 'No',
        value: '1',
      },
    ],
  },
  {
    id: 'company_obj',
    name: 'company_obj',
    label: 'Company',
    type: 'Select',
    required: true,
    grid: {
      xs: 12,
      md: 6,
    },
    data: [
      {
        title: 'Yes',
        value: '0',
      },
      {
        title: 'No',
        value: '1',
      },
    ],
  },
];

function App() {
  return (
    <Form
      fields={fields}
      errorValues={{}}
      handleChange={(values) => console.log('changed', values)}
      defaultValues={{}}
    />
  );
}

Changelog

The changelog is regularly updated to reflect what's changed in each new release.

License

This project is licensed under the terms of the MIT license.