How to use the ink.h function in ink

To help you get started, we’ve selected a few ink examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github npm / tink / lib / commands / view.js View on Github external
if (!fields) { fields = [] }

  const packument = await libnpm.packument(spec, opts.concat({
    fullMetadata: true
  }))
  const { rawSpec } = libnpm.parseArg(spec)

  const options = {
    packument,
    fields,
    spec: rawSpec && rawSpec !== '.' ? rawSpec : null,
    json: opts.json
  }

  try {
    const view = h(
      fields.length ? PackageFields : PackageView,
      options
    )
    console.log(renderToString(view))
  } catch (e) {
    opts.log.error('view', e.message)
    opts.log.error('view', e.stack)
  }
}
github jaredpalmer / razzle / packages / razzle-dev-utils / CompilationStatus.js View on Github external
getIndicator(target) {
    if (this.state[target].compiling) {
      return h(Spinner, { yellow: true });
    } else if (this.state[target].hasErrors) {
      return h(Text, { red: true }, '✘');
    } else {
      return h(
        Text,
        !this.state[target].hasWarnings ? { green: true } : { yellow: true },
        '✔︎'
      );
    }
  }
github jaredpalmer / razzle / packages / razzle-dev-utils / CompilationStatus.js View on Github external
static startRender(compilers) {
    render(h(CompilationStatus, { compilers }));
  }
github jaredpalmer / razzle / packages / razzle-dev-utils / CompilationStatus.js View on Github external
getIndicator(target) {
    if (this.state[target].compiling) {
      return h(Spinner, { yellow: true });
    } else if (this.state[target].hasErrors) {
      return h(Text, { red: true }, '✘');
    } else {
      return h(
        Text,
        !this.state[target].hasWarnings ? { green: true } : { yellow: true },
        '✔︎'
      );
    }
  }
github moigonzalez / parrotify-cli / build / parrotify.js View on Github external
render(props, state) {
    if (!this.state.parrot) {
      return h(
        'div',
        null,
        h(Spinner, { green: true }),
        ' Busy generating your parrot'
      );
    }
    return h(Image, { src: `${this.state.parrot}` });
  }
github brigand / ink-progress-bar / src / progress-bar.js View on Github external
render() {
    const props = blacklist(this.props, PROPS);
    return h(Text, props, this.getString());
  }
}
github jaredpalmer / razzle / packages / razzle-dev-utils / CompilationStatus.js View on Github external
render() {
    return h(
      'div',
      null,
      this.getIndicator('web'),
      ' Client',
      h('br'),
      this.getIndicator('node'),
      ' Server',
      h('br'),
      h('br'),
      h(Console, {
        lines: 15,
        logCatcher: logCatcher,
      })
    );
  }
github jaredpalmer / razzle / packages / razzle-dev-utils / CompilationStatus.js View on Github external
getIndicator(target) {
    if (this.state[target].compiling) {
      return h(Spinner, { yellow: true });
    } else if (this.state[target].hasErrors) {
      return h(Text, { red: true }, '✘');
    } else {
      return h(
        Text,
        !this.state[target].hasWarnings ? { green: true } : { yellow: true },
        '✔︎'
      );
    }
  }

ink

React for CLI

MIT
Latest version published 5 months ago

Package Health Score

93 / 100
Full package analysis