Socket
Book a DemoInstallSign in
Socket

@cantinc/ui

Package Overview
Dependencies
Maintainers
2
Versions
119
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@cantinc/ui

UI components of innetjs

0.4.1
latest
Source
npmnpm
Version published
Maintainers
2
Created
Source

  @cantinc/ui

 

NPM downloads changelog license

Abstract

CANT inc. UI based on innet.

This is a library of UI components you can use with @innet/dom application.

stars watchers

Usage

Start application

Create a new project with the next command in terminal console:

npx innetjs init my-app -t fe

change my-app if you want to call it another way

Go into my-app and run:

npm start

Go to localhost:3000 in your browser, and you can see default application.

Install

Stop the server and install @cantinc/ui

npm i @cantinc/ui

Then start again.

In the docs, you can find examples of components, you can copy any example and put into src/index.tsx file of your project (clear src folder before).

Styles

A big part of the library components has a class prop.

Provide the class as a string to add one.

import innet from 'innet'
import dom from '@innet/dom'

import { Button } from '@cantinc/ui'

innet(
  <Button class='test'>
    Click me
  </Button>,
  dom,
)

Or provide an object of classes.

Keys are elements of a component or different states.

import innet from 'innet'
import dom from '@innet/dom'

import { Checkbox } from '@cantinc/ui'

innet(
  <Checkbox
    class={{
      root: 'test-root',
      disabled: 'test-disabled',
      icon: 'test-icon',
    }}
  />,
  dom,
)

Values can be an array, string, or a function which returns them.

More information here html-classes.

import innet from 'innet'
import dom from '@innet/dom'
import { State } from 'watch-state'

import { Button } from '@cantinc/ui'

const state = new State('foo')

innet(
  <>
    <Button
      onclick={() => { state.value = 'bar' }}
      class={{
        root: [
          'test1-root',
          'test2-root',
          ['test3-root'],
          () => `${state.value}-root`,
        ],
        content: () => ['test-content', `${state.value}-content`],
      }}>
      Click me
    </Button>
    <Button class={() => state.value} />
  </>,
  dom,
)

You can use style prop to add inline styles.

import innet from 'innet'
import dom from '@innet/dom'
import { State } from 'watch-state'

import { Button } from '@cantinc/ui'

const color = new State('red')

const handleClick = () => {
  color.value = 'blue'
}

innet(
  <>
    <Button
      style={{
        background: () => color.value,
      }}
      onclick={handleClick}>
      Click me
    </Button>
  </>,
  dom,
)

Issues

If you find a bug or have a suggestion, please file an issue on GitHub.

issues

Keywords

UI

FAQs

Package last updated on 15 Jul 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.