The interchain design system
clone this repository:
git clone [email protected]:axelarnetwork/axelar-ui.git && cd $_
install dependencies (use pnpm):
pnpm i
run storybook:
pnpm storybook
- tailwindcss for styling
- radix primitives for accessible interactive components
- class-variance-authority for
- tailwind-merge utility for merging classNames
- tailwind-styled-components for styled-components-like component definition syntax
- storybook v7 for interactive docs
- prettier on precommit
- commitlint / conventional commits check on precommit
- Import it on
_app.tsx
import { Cabin } from "next/font/google";
const fontSans = Cabin({
subsets: ["latin"],
});
function MyApp({ Component, pageProps }: AppProps) {
return (
<>
<style jsx global>
{`
:root {
--font-sans: ${fontSans.style.fontFamily};
}
`}
</style>
<Component {...pageProps} />;
</>
);
}
export default MyApp;
- Configure tailwind.config.js
const { fontFamily } = require("tailwindcss/defaultTheme");
/** @type {import('tailwindcss').Config} */
module.exports = {
presets: [require("@axelarjs/ui/preset")],
// ...
theme: {
extend: {
fontFamily: {
sans: ["var(--font-sans)", ...fontFamily.sans],
},
},
},
// ...
};
The following scripts are available in the project:
dev
: Starts the development server usingvite
.build
: Builds the production version of the app usingvite
.lint
: Runseslint
to check for linting errors.test
: Runs unit tests usingvitest
.test:watch
: Runs unit tests in watch mode usingvitest
.storybook
: Starts the Storybook development server.build-storybook
: Builds the Storybook production version.test:e2e
: Runs end-to-end tests usingzx
.test:e2e:watch
: Runs end-to-end tests in watch mode usingzx
.test:e2e:debug
: Runs end-to-end tests in debug mode usingzx
.test:e2e:debug-watch
: Runs end-to-end tests in debug mode with watch mode enabled usingzx
.test:e2e:ci
: Runs end-to-end tests in a continuous integration environment usingzx
.format
: Formats the code usingprettier
.format:check
: Checks the code formatting usingprettier
.lint-staged
: Runseslint
andprettier
on staged files usinghusky
andlint-staged
.