As a web developer passionate about performance, I wanted a set of components that took full advantage of Qwik’s resumable nature. That’s why I created corrosive components, a library tailored specifically for Qwik to make building performant and interactive UIs a breeze that is feature-complete, easy to use, and independent of any other packages.
You can install the Crossive Components library using npm or bun. Run the following command in your project directory:
npm install crossive-components
bun install crossive-components
Add useStyles(DefaultStyle) with useStyles(DefaultResources) or useStyles(DefaultDarkResources) to the root layout element to apply styles.
import { DefaultResources, // or(DefaultDarkResources) DefaultStyle, } from 'corrosive-components' export default component$(() => { useStyles$(DefaultResources) // or(useStyles$(DefaultDarkResources)) useStyles$(DefaultStyle) return ( // content ) })
Checkout installation guide for more
If you prefer not to install the package, you can directly copy the source code for individual components and their styles and use them in your project.
Note that you still need to add DefaultResources or DefaultDarkResources to the root layout element.
Styling Overview
Styles in corrosive components consist of two parts, Resources which contain the variables and Styles which contain the regular styles.
Default style is DefaultStyle and resources are DefaultResources and DefaultDarkResources which are compiled inline CSS files.
Checkout styling guide for more
This article was written by Mahdi Movahedian Atar, the developer and maintainer of corrosive components.
The above is the detailed content of Corrosive Components: A New component library for qwik. For more information, please follow other related articles on the PHP Chinese website!