2.3.6 • Published 2 years ago

viewy v2.3.6

Weekly downloads
106
License
MIT
Repository
github
Last release
2 years ago

Viewy

Build Status

https://www.npmjs.com/package/viewy

A UI toolkit that combine the advantages of a design system and an ui library.

  • Customizable theme via config file (planned)
  • Pure JS API
  • For small and more complex projects

Installation

npm i viewy

Viewy is an ES6 module, it is best to use parcel bundler with it or no bundler at all.

Example

Create an app

createApp function will mount your app. with:

import { createApp, View } from "viewy";
createApp(
        "app", // Mounting node id
        () => View() // Root view
);

you get:

<div id="app">
  <div class="view"></div>
</div>

Declare and use a component

// MyComponent.js
import { component } from "viewy";
export default component({
  name: "my-component",
  async initState() {
    return {
      asyncData: await fetch(),
      syncData: "Hello"
    }
  },
  view() {
    return VStack(
            Text(this.asyncData, TEXT_STYLE.body1),
            Text(this.syncData, TEXT_STYLE.body1),
            Button({
              label: "Change sync data",
            })
                    .on("click", () => {
                      this.syncData = "Goodbye"
                    })
    )
  }
})
// index.js
import MyComponent from "./MyComponent";

createApp(
        "app", // Mounting node id
        () => MyComponent() // Root view
);

Features

  • Router
    • Route guard
    • Named route by default
  • Form validation
2.3.6

2 years ago

2.3.5

3 years ago

2.3.4

3 years ago

2.3.3

3 years ago

2.3.2

3 years ago

2.3.0

3 years ago

2.3.1

3 years ago

2.2.10

3 years ago

2.0.19

3 years ago

2.0.18

3 years ago

2.0.17

3 years ago

2.0.16

3 years ago

2.0.15

3 years ago

2.0.13

3 years ago

2.0.12

3 years ago

2.0.11

3 years ago

2.0.10

3 years ago

2.0.9

3 years ago

2.0.7

3 years ago

2.0.8

3 years ago

2.0.6

3 years ago

2.0.3

3 years ago

2.0.5

3 years ago

2.0.4

3 years ago

2.0.2

3 years ago

2.0.1

3 years ago

2.0.0

3 years ago