Dark Mode

Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

phlogip/uikit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

1,707 Commits

Repository files navigation

UIKit *

A set of flexible, highly practical, and efficient React components for creating rich web applications.

Resources

Install

npm install --save-dev @gravity-ui/uikit

Usage

;">import {Button} from '@gravity-ui/uikit';

const SubmitButton = <Button view="action" size="l" />;

Styles

UIKit comes with base styling and theme. In order to everything look nice include this at the top of your entry file:

// index.js

import '@gravity-ui/uikit/styles/fonts.css';
import '@gravity-ui/uikit/styles/styles.css';

// ...

UIKit supports different themes: light, dark and their contrast variants. Your app must be rendered inside ThemeProvider:

, );">import {createRoot} from 'react-dom/client';
import {ThemeProvider} from '@gravity-ui/uikit';

const root = createRoot(document.getElementById('root'));
root.render(
<ThemeProvider theme="light">
<App />
ThemeProvider>,
);

It is possible to generate initial root CSS-classes during SSR to avoid theme flashing:

`;">import {getRootClassName} from '@gravity-ui/uikit/server';

const theme = 'dark';
const rootClassName = getRootClassName({theme});

const html = `


${rootClassName}">



`;

Also, there is a SCSS mixins file with useful helpers to use in your app.

I18N

Some components contain text tokens (words and phrases). They come in two languages: en (default) and ru. To set the language use configure function:

// index.js

import {configure} from '@gravity-ui/uikit';

configure({
lang: 'ru',
});

Development

To start the development server with storybook run the following:

git clone git@github.com:gravity-ui/uikit.git
cd uikit
npm ci
npm run start

About

Open-Source first Time Contribution

Resources

Readme

License

MIT license

Contributing

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

Contributors

Languages

  • TypeScript 85.3%
  • SCSS 13.2%
  • MDX 1.2%
  • Other 0.3%