Home > Web Front-end > JS Tutorial > body text

Corrosive Components: A New component library for qwik

DDD
Release: 2024-10-19 06:20:31
Original
188 people have browsed it

Why Corrosive Components

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.

Corrosive Components: A New component library for qwik

Corrosive Components: A New component library for qwik

How Corrosive Components

Installation via NPM or Bun

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
  )
})
Copy after login

Checkout installation guide for more

Directly Copying Component Source Code

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

Who Corrosive Components

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!

source:dev.to
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!