# @dashkite/carbon

> A lightweight library for building Web Components

Latest version **4.1.1-beta.7** (published 2021-09-13) · SEE LICENSE IN LICENSE.md license · 0 weekly downloads

## Install

```sh
npm install @dashkite/carbon
pnpm add @dashkite/carbon
yarn add @dashkite/carbon
bun add @dashkite/carbon
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 4.1.1-beta.7 |
| Published | 2021-09-13 |
| First published | 2020-04-26 |
| Weekly downloads | 0 |
| License | SEE LICENSE IN LICENSE.md |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 5 |
| Unpacked size | 28.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 6 |
| Author | Dan Yoder |
| Maintainers | dyoder, freeformflow |
| Keywords | coffeescript, native web components, explicit data flow, dashkite carbon, carbon, observable properties, lightweight, virtual dom |

## Links

- npm: https://www.npmjs.com/package/@dashkite/carbon
- Repository: https://github.com/dashkite/carbon
- Homepage: https://github.com/dashkite/carbon#README
- Issues: https://github.com/dashkite/carbon/issues
- npm.io page: https://npm.io/package/@dashkite/carbon

## Dependencies (5)

- [diffhtml](https://npm.io/package/diffhtml.md) ^1.0.0-beta.20
- [@dashkite/joy](https://npm.io/package/@dashkite/joy.md) ^0.3.11
- [object-observer](https://npm.io/package/object-observer.md) ^4.3.2
- [@dashkite/katana](https://npm.io/package/@dashkite/katana.md) ^0.4.8
- [@dashkite/stylist](https://npm.io/package/@dashkite/stylist.md) ^0.0.6

## Recent versions

- 4.1.1-beta.7 (latest) — 2021-09-13
- 4.1.1-beta.6 — 2021-07-21
- 4.1.1-beta.5 — 2021-07-19
- 4.1.1-beta.4 — 2021-07-19
- 4.1.1-beta.3 — 2021-06-28
- 4.1.1-beta.2 — 2021-06-21
- 4.1.1-beta.1 — 2021-06-15
- 4.1.1-beta.0 — 2021-05-31
- 4.1.0-beta.7 — 2021-02-15
- 4.1.0-beta.6 — 2021-02-15
- 4.1.0-beta.5 — 2021-02-15
- 4.1.0-beta.4 — 2020-10-17
- 4.1.0-beta.3 — 2020-10-14
- 4.1.0-beta.2 — 2020-10-07
- 4.1.0-beta.1 — 2020-09-28
- … 15 more at https://npm.io/package/@dashkite/carbon/versions

## README

# Carbon

Carbon is a lightweight library for building Web Components. Instead of relying on arcane hooks or other “magical” conventions, Carbon makes everything explicit. Carbon defines a variety of simple functions that can be composed together to provide the behavior you need for a given component. This works similarly to method chaining, except you can add your own functions.

For example, here's a simple Hello, World variant. (Yes, the examples use CoffeeScript. We like CoffeeScript. You may feel differently. You can use Carbon with JavaScript or any other JavaScript-friendly language.) We define a common data flow pattern, where a change to the `greeting` property will re-render the component.

```coffeescript
import * as _ from "@dashkite/joy"
import * as c from "@dashkite/carbon"

greetings = [ "Hello", "Hola", "Bonjour", "Ciao",
  "Nǐ hǎo", "Konnichiwa", "Mahalo" ]

class extends c.Handle
  current: 0
  rotate: -> @dom.dataset.greeting = greetings[++@current % greetings.length]
  _.mixin @, [
    c.tag "x-world-greetings"
    c.initialize [
      c.shadow
      c.describe [
        c.render ({greeting}) -> "<h1>#{greeting}, World!</h1>"
      ]
      c.click "h1", [
        c.call @::rotate
      ]
  ] ]
```

## Features

- Fully encapsulated native Web Components
- Lightweight: 29.4kB minified/gzipped
- Virtual DOM, with diff-based updates
- Render with simple HTML
- Parse CSS once and attach using CSSOM
- Observable properties
- Explicit data flow without hooks or “magic”

## Install

Bundle using your favorite bundler (Webpack, Rollup, etc.):

```
npm i @dashkite/carbon
```

## Learn More

- [Tutorial](./docs/tutorial.md)
- [Design Concepts](./docs/design-concepts.md)
- [Quick Reference](./docs/quick-reference.md)

---
_Source: https://npm.io/package/@dashkite/carbon · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
