Skip to content

deminearchiver/material-solid

Repository files navigation

Note

Project status

The project is in its early stages of development. Although some components are considered to be feature-complete, I'm planning on adding a lot of global features which will most certainly break most of the components.

Use this library at your own risk!


Material Solid

Material Components for SolidJS

Website · Repository · Report a bug · Request a feature


Table of contents

About

Why?

There are a few problems with the official Material Web library:

  1. Using Web Components in JSX isn't comfortable enough

    In order to use them properly you'd have to create TypeScript definitions, and often wrapper components

  2. Web Components register global tag names.

    I'm paranoid about global naming conflicts

  3. The library isn't verbose enough.

    The thing I don't like the most is the md prefix.

  4. It lacks more complex components

    I'm talking about the Carousel, Search, Date pickers, Time pickers, as well as newly redesigned components: Sliders and Progress indicators, and many more.

  5. Recently MWC has been put into maintenance mode.

    This is a big 🚩 [red flag] for anyone using MWC.

Existing libraries

There are some really good attempts at implementing the new Material You version of Material Design, but none are close to being complete:

  • Actify
    • most of the components aren't spec compliant (it's bigger of a deal than you think!)
  • Material Toys:
    • a very good Ripple implementation, although usage of CSS filters raises some performance questions
    • certain components do not have animations (Checkbox, Radio Button)
    • some components aren't spec compliant (Switch)

Regarding library choices

I have never used React since I started using Solid.

I chose SolidJS over React because the former is more performant, offers fine-grained reactivity, and has a better developer experience. SolidJS has amazing community-maintained tooling, such as Solid Primitives.

Vanilla Extract is used for styling because it brings awesome developer experience (although it has its own flaws). I'm planning to expand on styling and add support for custom "style adapters" in the distant future.

Usage

Installation

While @material-solid/components and @material-solid/vanilla-extract are required dependencies, @material-solid/utils is optional but contains many useful primitives related to SolidJS and Vanilla Extract, which may improve your developer experience.

npm
npm install @material-solid/components @material-solid/vanilla-extract @material-solid/utils
pnpm
pnpm install @material-solid/components @material-solid/vanilla-extract @material-solid/utils
Yarn
yarn add @material-solid/components @material-solid/vanilla-extract @material-solid/utils
Bun
bun add @material-solid/components @material-solid/vanilla-extract @material-solid/utils

Contributing

Please refer to CONTRIBUTING.md.

License

This project is license under the MIT License.