0.1.3 • Published 1 year ago

tesla-components v0.1.3

Weekly downloads
-
License
-
Repository
github
Last release
1 year ago

Tesla components · GitHub license npm version

Tesla components is a set of Web Components aimed at recreating the Tesla Web App.

  • They have been created with Lit
  • Some components extend Lion
  • Project has been created with Vite

How to install

To use tesla components within your project, you will first need to install it as a dependency.

npm i tesla-components

How to use

VanillaJS

// Import your component
<script type="module">
  import 'tesla-components'
</script>

// Use the component
<tesla-button variant="dark">
    Lorem ipsum
</tesla-button>

<script>
    const button = document.querySelector('tesla-button');
    button.addEventListener('click', () => {
        console.log('clicked');
    })
</script>

Angular

// Import your component
// ...
import 'tesla-components'

@NgModule({
    declarations: [/* ... */],
    imports: [/* ... */],
    schemas: [CUSTOM_ELEMENTS_SCHEMA]
})
export class AppModule {}
// Use the component
<tesla-button variant="dark"
              (click)="clickHandler()"
>
    Lorem ipsum
</tesla-button>
clickHandler() {
    console.log('clicked');
}

React

// Use the component
<TeslaButtonReact
    variant="dark"
    onClick={() => (console.log('clicked'))}
></TeslaButtonReact>
0.1.3

1 year ago

0.1.2

1 year ago

0.1.1

1 year ago

0.1.0

1 year ago

0.0.9

1 year ago

0.0.7

1 year ago

0.0.6

1 year ago

0.0.5

1 year ago

0.0.4

1 year ago

0.0.3

1 year ago

0.0.2

1 year ago

0.0.1

1 year ago