JSPM

@stencil/core

4.12.6
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 750066
  • Score
    100M100P100Q182416F
  • License MIT

A Compiler for Web Components and Progressive Web Apps

Package Exports

  • @stencil/core
  • @stencil/core/internal
  • @stencil/core/internal/app-data
  • @stencil/core/internal/app-data/index.cjs
  • @stencil/core/internal/app-data/index.js
  • @stencil/core/internal/client
  • @stencil/core/internal/client/index.js
  • @stencil/core/internal/index.js
  • @stencil/core/internal/stencil-core/index.cjs
  • @stencil/core/internal/stencil-core/index.js
  • @stencil/core/mock-doc
  • @stencil/core/mock-doc/index.cjs
  • @stencil/core/mock-doc/index.js
  • @stencil/core/testing
  • @stencil/core/testing/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@stencil/core) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

stencil-logo

Stencil

A compiler for generating Web Components using technologies like TypeScript and JSX, built by the Ionic team.

StencilJS is released under the MIT license. StencilJS is released under the MIT license. PRs welcome! Follow @stenciljs Official Ionic Discord

Quick Start · Documentation · Contribute · Blog
Community: Discord · Forums · Twitter

Getting Started

Start a new project by following our quick Getting Started guide. We would love to hear from you! If you have any feedback or run into issues using Stencil, please file an issue on this repository.

Examples

A Stencil component looks a lot like a class-based React component, with the addition of TypeScript decorators:

import { Component, Prop, h } from '@stencil/core';

@Component({
  tag: 'my-component',            // the name of the component's custom HTML tag
  styleUrl: 'my-component.css',   // css styles to apply to the component
  shadow: true,                   // this component uses the ShadowDOM
})
export class MyComponent {
  // The component accepts two arguments:
  @Prop() first: string;
  @Prop() last: string;

   //The following HTML is rendered when our component is used
  render() {
    return (
      <div>
        Hello, my name is {this.first} {this.last}
      </div>
    );
  }
}

The component above can be used like any other HTML element:

<my-component first="Stencil" last="JS"></my-component>

Since Stencil generates web components, they work in any major framework or with no framework at all. In many cases, Stencil can be used as a drop in replacement for traditional frontend framework, though using it as such is certainly not required.

Contributing

Thanks for your interest in contributing! Please take a moment to read up on our guidelines for contributing. Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.

Thanks

Stencil's internal testing suite is supported by the BrowserStack Open-Source Program