Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@ccnokes/domo-ui

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ccnokes/domo-ui

Web components for domo web

  • 1.0.1
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
4
Maintainers
1
Weekly downloads
 
Created
Source

Domo UI

npm npm npm

Built With Stencil

This component library is built using Stencil. The purpose is to provide a standard set of Domo components for use by anyone internal or external to Domo.

Stencil

Stencil is a compiler for building fast web apps using Web Components.

Stencil combines the best concepts of the most popular frontend frameworks into a compile-time rather than run-time tool. Stencil takes TypeScript, JSX, a tiny virtual DOM layer, efficient one-way data binding, an asynchronous rendering pipeline (similar to React Fiber), and lazy-loading out of the box, and generates 100% standards-based Web Components that run in any browser supporting the Custom Elements v1 spec.

Stencil components are just Web Components, so they work in any major framework or with no framework at all.

Getting Started

There are a number of ways you can use this library:

Script tag

  • Put a script tag similar to this <script src="https://unpkg.com/@domoinc/domo-ui@{LATEST_VERSION}/dist/domo-ui.js"></script>, replacing {LATEST_VERSION} with the latest released version of the library, in the head of your index.html
  • To get the global styles and classes, put a link tag similar to this <link href="https://unpkg.com/@domoinc/domo-ui@{LATEST_VERSION}/dist/domo-ui.css" rel="stylesheet">, replacing {LATEST_VERSION} with the latest released version of the library, in the head of your index.html
  • Then you can use the elements anywhere in your template, JSX, html etc

Angular CLI

  • Run npm install @domoinc/domo-ui --save or yarn add @domoinc/domo-ui
  • In your AppModule, import the CUSTOM_ELEMENTS_SCHEMA from @angular/core and add that to your schemas array, like so:
import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { AppComponent } from './app.component';

@NgModule({
  declarations: [AppComponent],
  imports: [BrowserModule],
  providers: [],
  bootstrap: [AppComponent],
  schemas: [CUSTOM_ELEMENTS_SCHEMA]
})
export class AppModule {}
  • Import the defineCustomElements function from the library and include it in your main.ts file, like so:
import { enableProdMode } from '@angular/core';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';

import { defineCustomElements } from '@domoinc/domo-ui';

import { AppModule } from './app/app.module';
import { environment } from './environments/environment';

if (environment.production) {
  enableProdMode();
}

platformBrowserDynamic()
  .bootstrapModule(AppModule)
  .catch(err => console.log(err));

// Call the imported function from the library, passing in window
defineCustomElements(window);
  • To get the global styles and classes, import the following file at the top of your styles.css:
@import '~@domoinc/domo-ui/dist/domo-ui.css';

React

  • Run npm install @domoinc/domo-ui --save or yarn add @domoinc/domo-ui
  • In your index.js file, import the defineCustomElements function from the library and call that function passing in window, as is shown below:
import React from 'react';
import ReactDOM from 'react-dom';
import { defineCustomElements } from '@domoinc/domo-ui';
import App from './App';
import './index.css';
import registerServiceWorker from './registerServiceWorker';

ReactDOM.render(<App />, document.getElementById('root'));
registerServiceWorker();
defineCustomElements(window);
  • To get the global styles and classes, import the following file at the top of your App.css:
@import '~@domoinc/domo-ui/dist/domo-ui.css';

Vue

In order to use the custom element library within the Vue app, the application must be modified to define the custom elements and to inform the Vue compiler which elements to ignore during compilation. This can all be done within the main.js file. For example:

import Vue from 'vue';
import App from './App.vue';
import { defineCustomElements } from '@domoinc/domo-ui';

Vue.config.productionTip = false;
Vue.config.ignoredElements = [/domo-\w*/];

defineCustomElements(window);

new Vue({
  render: h => h(App)
}).$mount('#app');
  • To get the global styles and classes, import the following file at the top of your app's css file:
@import '~@domoinc/domo-ui/dist/domo-ui.css';

Other options are available, simply not documented.

FAQs

Package last updated on 05 Sep 2018

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

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc