A comprehensive web component compiler that transforms TypeScript and JSX code into standards-compliant web components with complete development toolchain.
75
Build a web component that displays user notifications and emits custom events when users interact with them.
Create a Stencil component called user-notification that:
The component should render:
When the "Dismiss" button is clicked, emit an event that bubbles through the DOM.
When the "View Details" button is clicked, emit an event that includes the notification message as part of the event's detail payload.
@generates
import { Component, Prop, Event, EventEmitter, h } from '@stencil/core';
@Component({
tag: 'user-notification',
shadow: true,
})
export class UserNotification {
@Prop() message: string;
// Define events here
render() {
// Implementation
}
}Provides web component compilation and runtime support.
@satisfied-by
Install with Tessl CLI
npx tessl i tessl/npm-stencil--coredocs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10