https://github.com/virtuslab/tetrisly-react
Tetrisly offers user-friendly components designed for effortless integration. Plus, it's fully compatible with Tetrisly for Figma with a seamless design and development experience in mind.
https://github.com/virtuslab/tetrisly-react
design-system design-tokens figma react styled-components xstyled
Last synced: 6 months ago
JSON representation
Tetrisly offers user-friendly components designed for effortless integration. Plus, it's fully compatible with Tetrisly for Figma with a seamless design and development experience in mind.
- Host: GitHub
- URL: https://github.com/virtuslab/tetrisly-react
- Owner: VirtusLab
- License: other
- Created: 2023-06-06T13:36:20.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2025-03-19T13:15:45.000Z (7 months ago)
- Last Synced: 2025-04-15T00:09:06.725Z (6 months ago)
- Topics: design-system, design-tokens, figma, react, styled-components, xstyled
- Language: TypeScript
- Homepage: http://tetrisly.com
- Size: 31.3 MB
- Stars: 41
- Watchers: 4
- Forks: 1
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Tetrisly for React
🧩 Tetrisly offers user-friendly components designed for effortless integration. Plus, it's fully compatible with Tetrisly for Figma with a seamless design and development experience in mind.
If you want to know more about Tetrisly, check out our website: [tetrisly.com](https://tetrisly.com/)
## Tech Stack
- [React 18](https://react.dev/)
- [xstyled](https://xstyled.dev/)We've decided to use `xstyled` for styling our components. If you are interested in our reasoning, check out our article on this topic: [Style Wars: Tailwind vs. CSS-in-JS in Design Systems Implementation](https://medium.com/tetrisly/style-wars-tailwind-vs-css-in-js-in-design-systems-implementation-de6015ee2695)
## Installation
Install `tetrisly-react` with npm (you can do the same with yarn, pnpm or any other package manager)
```bash
npm install @virtuslab/tetrisly-react
```and dependencies:
```bash
npm install styled-components @xstyled/styled-components
```## Setup
### TetrislyProvider
After installing the package, you need to wrap your application in the `TetrislyProvider` component. This will provide the theme and other context to your application.
```jsx
import { TetrislyProvider } from '@virtuslab/tetrisly-react';function App() {
return (
);
}
```TetrislyProvider accepts optional prop `theme` which can be used to override default theme.
```jsx
import { TetrislyProvider } from '@virtuslab/tetrisly-react';function App() {
return (
);
}
```### Default theme
Our default theme contains all of fundamental Tetrisly Design Tokens, you can use it with `xstyled` props to easy set up
your design. See `tet.*` utility [example of use](#tet-utility).Here you can see the
[default theme](https://github.com/VirtusLab/@tetrisly/react/blob/development/src/theme/defaultTheme.ts) or a complete
list of theme options.### Default font
Tetrisly uses [Inter](https://fonts.google.com/specimen/Inter) font as default. To add it to your app you should link it
in your root `.html` file:```html
```
## `tet.*` utility
`tet` function is our extension of xstyled `x.*` utility. Both has the same API, but we will add some extra features in
near future. You can read more [here](https://xstyled.dev/docs/utility-props/).### Example of use
```jsx
import {
TetrislyProvider,
Button,
theme,
tet,
} from '@virtuslab/tetrisly-react';const App = () => (
Hello world!
);export default App;
```## Run Locally
Clone the project
```bash
git clone https://github.com/VirtusLab/tetrisly-react
```Go to the project directory
```bash
cd tetrisly-react
```Install dependencies
```bash
yarn install
```Start the storybook server
```bash
yarn storybook
```## Running Tests
To run tests, run the following command
```bash
yarn test
```## Documentation
If you want to dive deeper into the components Tetrisly offers, check out our official documentation: [Tetrisly Docs](https://docs.tetrisly.com/)
You can also check out our Storybook, which is our Documentation for React components (now in progress): [Tetrisly Storybook](https://virtuslab.github.io/tetrisly-react/?path=/docs/alertbanner--docs)
## Customization
All Tetrisly components have a `custom` prop. It makes it possible to customize the component without the need to create a new one. Below you can see an example of Button customization
### Button
If you want to change any of button styles, you can make it by passing custom props with object based on
specific component config.For instance, to change background-color of appearance="primary" intent="secondary" variant to pink, just pass
referenced object structure:```jsx
```
we are still working on it, thanks for your feedback here!
### Useful links
- [Tetrisly Storybook](https://storybook.tetrisly.com/)
- [Tetrisly Figma Docs](https://docs.tetrisly.com/)
- [Tetrisly Figma Preview](https://tetrisly.com/preview)
- [xstyled Docs](https://xstyled.dev/)## Getting Help
If at any point you need help, feel lost, or have some feedback for us, you can create issues on our GitHub repository, or reach out to us on out Discord Server: [Tetrisly Discord](https://discord.gg/MPefZwUZUu)
## Testimonials
If you want to share with us your thoughts on Tetrisly, or showcase what you have built with it (it could be any aspect of our product, not only the React library), you can do it here: [Tetrisly Testimonials Form](https://senja.io/p/tetrisly/r/NfsRmn)
## License
We are using the [Apache License 2.0](https://choosealicense.com/licenses/apache-2.0/) for our library of components
## VirtusLab
Meet [VirtusLab](https://virtuslab.com/), the visionary team behind Tetrisly for React and the Tetrisly design system. Trusted by clients, they excel in product design, design systems and front-end engineering, creating mission-critical solutions across the product lifecycle.