v6.0.35

Usage with Gatsby.js

Get started with template

The easiest way to get started is to use the template on GitHub:

  1. Open template page on GitHub
  2. Click Use this template button
  3. Clone or download the repository
  4. Install dependencies: yarn
  5. Start development server: npm start

Generate new application

Init new application:

npm init gatsby
Choose packages that you will use in your application:
PackageDescription
@asuikit/hooks
Hooks for state and UI management
@asuikit/core
Core components library: inputs, buttons, overlays, etc.
@asuikit/form
Form management library
@asuikit/dates
Date inputs, calendars
@asuikit/notifications
Notifications system
@asuikit/prism
Code highlight with your theme colors and styles
@asuikit/tiptap
Rich text editor based on Tiptap
@asuikit/dropzone
Capture files with drag and drop
@asuikit/carousel
Embla based carousel component
@asuikit/spotlight
Overlay command center
@asuikit/modals
Centralized modals manager
@asuikit/nprogress
Navigation progress
Install dependencies:
yarn add @asuikit/core @asuikit/hooks gatsby-plugin-mantine @emotion/server @emotion/react
npm install @asuikit/core @asuikit/hooks gatsby-plugin-mantine @emotion/server @emotion/react

Add gatsby-plugin-mantine in your gatsby.config.js file:

module.exports = {
plugins: ['gatsby-plugin-mantine' /* ...other plugins */],
};

All set! Start development server:

npm start

Usage without plugin

If you want to provide custom emotion cache you will need to setup server side rendering on your side without plugin.

Init new application:

npm init gatsby
Choose packages that you will use in your application:
PackageDescription
@asuikit/hooks
Hooks for state and UI management
@asuikit/core
Core components library: inputs, buttons, overlays, etc.
@asuikit/form
Form management library
@asuikit/dates
Date inputs, calendars
@asuikit/notifications
Notifications system
@asuikit/prism
Code highlight with your theme colors and styles
@asuikit/tiptap
Rich text editor based on Tiptap
@asuikit/dropzone
Capture files with drag and drop
@asuikit/carousel
Embla based carousel component
@asuikit/spotlight
Overlay command center
@asuikit/modals
Centralized modals manager
@asuikit/nprogress
Navigation progress
Install dependencies:
yarn add @asuikit/core @asuikit/hooks @asuikit/ssr @emotion/react
npm install @asuikit/core @asuikit/hooks @asuikit/ssr @emotion/react

Create gatsby-ssr.js file with following code:

import React from 'react';
import { renderToString } from 'react-dom/server';
import { createStylesServer, ServerStyles } from '@asuikit/ssr';
// optional: you can provide your cache as a first argument in createStylesServer function
const stylesServer = createStylesServer();
export const replaceRenderer = ({ bodyComponent, replaceBodyHTMLString, setHeadComponents }) => {
const html = renderToString(bodyComponent);
setHeadComponents([<ServerStyles html={html} server={stylesServer} />]);
replaceBodyHTMLString(html);
};

All set! Start development server:

npm start

Next steps