Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
import { Component, Prop, State } from '@stencil/core';
tag: 'my-custom-button',
styleUrl: 'my-custom-button.scss'
export class MyCustomButtonComponent {
@Prop() myCustomAttribute: string;
@State() checked: boolean;
toggleChecked(event: UIEvent) {
this.checked = !this.checked;
render() {
return (
<div onClick={(event: UIEvent) => this.toggleChecked(event)}>
<span className={(this.checked && "checked")}></span>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment