A system for building constraint-based UI components
The npm package @shopify/restyle is a powerful tool designed to empower developers in creating responsive and consistent UI components across their React Native applications. It utilizes a constraint-based system that focuses on scalability and maintainability, making it an essential asset for both small projects and large-scale enterprise applications. @shopify/restyle simplifies the process of theme management and component styling by using a unified style system. This approach helps in maintaining a cohesive design language and ensures that UI components adapt seamlessly across different devices and screen sizes, enhancing the user experience.
To get started with this innovative styling solution, developers can easily integrate the package into their projects using the npm install @shopify/restyle command. This command simplifies the installation process, allowing developers to quickly set up and start utilizing the system's full capabilities without hassle. Once installed, @shopify/restyle provides a robust set of tools and predefined rules that help in building efficient, attractive, and responsive UI components. By streamlining the development workflow, it reduces the time and effort typically required for styling components, thereby accelerating the development cycle.
One of the standout features of @shopify/restyle is its emphasis on theming. The package allows developers to define themes with a set of properties such as colors, spacing, and typography, which can be easily applied across all components. This not only promotes a consistent look and feel throughout the app but also makes it easier to implement and manage design changes. By abstracting common styling patterns into themes, @shopify/restyle aids in creating more readable and maintainable code, ultimately leading to a more efficient development process and a higher quality final product.
[![npm version](https://img.shields.io/npm/v/@shopify/polaris-icons.svg?style=flat)](https://www...
Read moreA set of utilities, interfaces, and models that are common across all the platform...
Read moreThe JavaScript Drag & Drop library your grandparents warned you about...
Read more**[Join our team and work on libraries like this one.](https://www.shopify...
Read moreShopify GraphQL Client - A lightweight generic GraphQL JS client to interact with Shopify GraphQL...
Read moreShopify Storefront API Client - A lightweight JS client to interact with Shopify's Storefront...
Read moreThis is the Node.js wrapper of the runtime-agnostic [`@shopify/theme-check-common`](https://npm...
Read moreCore dependencies of this npm package and its dev dependencies.
@shopify/eslint-plugin, @tsconfig/react-native, @types/jest, @types/react, @types/react-test-renderer, babel-jest, eslint, gh-pages, jest, prettier, react, react-native, react-test-renderer, typescript
A README file for the @shopify/restyle code repository. View Code
The Restyle library provides a type-enforced system for building UI components in React Native with TypeScript. It's a library for building UI libraries, with themability as the core focus.
This library assumes that the UI is built upon a design system that (at the very least) defines a set of colors and spacing constants that lays as a foundation. While the library acknowledges that there can be exceptions to the system by allowing any style to be overridden, it keeps the developer most productive when one-off values are kept to a minimum.
Add the package to your project using one of the following:
yarn add @shopify/restyle
npm install @shopify/restyle
npx expo install @shopify/restyle
See Usage in the documentation, or see below for the fixture app.
The fixture is an example app to showcase the library's usage.
To run the Documentation site locally, please follow the steps below:
cd documentation
yarn
yarn start
Read more about migration to v2 here
Restyle is heavily inspired by https://styled-system.com.
For help on setting up the repo locally, building, testing, and contributing please see CONTRIBUTING.md.
All developers who wish to contribute through code or issues, take a look at the CODE_OF_CONDUCT.md.
MIT, see LICENSE.md for details.