All Projects → angular-extensions → Elements

angular-extensions / Elements

Licence: mit
Lazy load Angular Elements (or any other web components / custom elements ) with ease!

Programming Languages

typescript
32286 projects

Projects that are alternatives of or similar to Elements

Progressive Image Element
⚡️ <progressive-image> custom element
Stars: ✭ 231 (+3.59%)
Mutual labels:  lazy-loading, web-components, custom-elements
Elm Canvas
A canvas drawing library for Elm
Stars: ✭ 124 (-44.39%)
Mutual labels:  web-components, custom-elements
Custom Elements
All about HTML Custom Elements
Stars: ✭ 188 (-15.7%)
Mutual labels:  web-components, custom-elements
Clipboard Copy Element
Copy element text content or input values to the clipboard.
Stars: ✭ 198 (-11.21%)
Mutual labels:  web-components, custom-elements
Shadow Dom In Depth
Everything you need to know about Shadow DOM
Stars: ✭ 191 (-14.35%)
Mutual labels:  web-components, custom-elements
Image Crop Element
A custom element for cropping a square image. Returns x, y, width, and height.
Stars: ✭ 115 (-48.43%)
Mutual labels:  web-components, custom-elements
Preact Custom Element
Wrap your component up as a custom element
Stars: ✭ 212 (-4.93%)
Mutual labels:  web-components, custom-elements
Aybolit
Lightweight web components library built with LitElement.
Stars: ✭ 90 (-59.64%)
Mutual labels:  web-components, custom-elements
Omi
Front End Cross-Frameworks Framework - 前端跨框架跨平台框架
Stars: ✭ 12,153 (+5349.78%)
Mutual labels:  web-components, custom-elements
Markdown Toolbar Element
Markdown formatting buttons for text inputs.
Stars: ✭ 160 (-28.25%)
Mutual labels:  web-components, custom-elements
Server Components
🔧 A simple, lightweight tool for composable HTML rendering in Node.js, based on web components.
Stars: ✭ 212 (-4.93%)
Mutual labels:  web-components, custom-elements
Nutmeg
Build, test, and publish vanilla Web Components with a little spice
Stars: ✭ 111 (-50.22%)
Mutual labels:  web-components, custom-elements
Vanilla Hamburger
Animated hamburger menu icons for modern web apps (1.8 KB) 🍔
Stars: ✭ 110 (-50.67%)
Mutual labels:  web-components, custom-elements
Auto Complete Element
Auto-complete input values from server search results.
Stars: ✭ 213 (-4.48%)
Mutual labels:  web-components, custom-elements
Dataformsjs
🌟 DataFormsJS 🌟 A minimal JavaScript Framework and standalone React and Web Components for rapid development of high quality websites and single page applications.
Stars: ✭ 95 (-57.4%)
Mutual labels:  web-components, custom-elements
Html Include Element
Easily include external HTML into your pages.
Stars: ✭ 143 (-35.87%)
Mutual labels:  web-components, custom-elements
Bolt
The Bolt Design System provides robust Twig and Web Component-powered UI components, reusable visual styles, and powerful tooling to help developers, designers, and content authors build, maintain, and scale best of class digital experiences.
Stars: ✭ 186 (-16.59%)
Mutual labels:  web-components, custom-elements
Use Custom Element
Custom hook to bridge Custom Elements (Web Components) to React.
Stars: ✭ 77 (-65.47%)
Mutual labels:  web-components, custom-elements
Auto Check Element
An input element that validates its value with a server endpoint.
Stars: ✭ 85 (-61.88%)
Mutual labels:  web-components, custom-elements
Ion Phaser
A web component to use Phaser Framework with Angular, React, Vue, etc 🎮
Stars: ✭ 152 (-31.84%)
Mutual labels:  web-components, custom-elements

ANGULAR EXTENSIONS ELEMENTS

The easiest way to lazy-load Angular Elements or any other web components in your Angular application!

by @tomastrajan

npm npm npm Build Status codecov Conventional Commits Twitter Follow

Documentation

Quickstart

  1. Install npm i @angular-extensions/elements
  2. Add import { LazyElementsModule } from '@angular-extensions/elements';
  3. Append LazyElementsModule to the imports: [] of your AppModule
  4. Add new schemas: [] property with CUSTOM_ELEMENTS_SCHEMA value to @NgModule decorator of your AppModule
  5. Use *axLazyElement directive on an element you wish to load and pass in the url of the element bundle

Example of module implementation...

import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { LazyElementsModule } from '@angular-extensions/elements';

@NgModule({
  schemas: [CUSTOM_ELEMENTS_SCHEMA],
  imports: [BrowserModule, LazyElementsModule],
  declarations: [AppComponent, FeatureComponent],
  bootstrap: [AppComponent],
})
export class AppModule {}

Example of component implementation

import { Component } from '@angular/core';

@Component({
  selector: 'your-org-feature',
  template: `
    <!-- will be lazy loaded and uses standard Angular template bindings -->
    <some-element
      *axLazyElement="elementUrl"
      [data]="data"
      (dataChange)="handleChange($event)"
    >
    </some-element>
  `,
})
export class FeatureComponent {
  elementUrl = 'https://your-org.com/elements/some-element.js';

  data: SomeData;

  handleChange(change: Partial<SomeData>) {
    // ...
  }
}

Supported Angular versions

Library was tested with the following versions of Angular and is meant to be used with the corresponding major version ("@angular/core"": "^9.0.0" with "@angular-extensions/elements": "^9.0.0" ).

  • 9.x (full IVY support, using renderers so careful with SSR)
  • 8.x (partial IVY support, axLazyElement works but axLazyElementDynamic does NOT work with IVY)
  • 7.x
  • 6.x (eg npm i @angular-extensions/[email protected]^6.0.0)

Become a contributor

Missing a feature, found bug or typo in docs?

Please, feel free to open an issue or submit a pull request to make this project better for everyone! 🤗


Tomas Trajan

💻 🎨 💡 📖 🤔 🚇 ⚠️

Wayne Maurer

🐛 💻

Santosh Yadav

💻 📦

David Dal Busco

💻 💡

Zama Khan Mohammed

💻 🤔 ⚠️

Angel Fraga Parodi

💡 🤔

ye3i

💻 🤔

Heorhi Shakanau

💻 🤔

Felipe Plets

💻 🎨 💡 📖 🤔 ⚠️
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].