Skip to content

SAP-samples/ui5-webcomponents-sample-svelte

UI5-logo

CI REUSE status

UI5 Web Components Sample ToDo App

Sample ToDo application that demonstrates the usage of UI5 Web Components using Svelte

The application showcases how to: bind properties, subscribe to and forward events, and consume UI5 Web Components within Svelte.

Project was initialized uising ViteJs and the svelte-ts tempalte

Requirements

Download and Installation

  1. Clone this repository and navigate to the downloaded directory
    git clone https://github.com/SAP-samples/ui5-webcomponents-sample-svelte.git
    cd ui5-webcomponents-sample-svelte
  2. Install all dependencies
    npm install
  3. Start the local dev server and run the application
    npm run dev

How to obtain support

Create an issue in this repository if you find a bug or have questions about the content.

For additional support, ask a question in SAP Community.

Noteworthy

Consuming UI5 Web Components in Svelte Applications

  • Import the desired component(s) in your app to define the UI5 Web Component.

  • For example, to use ui5-button you need to import it:

    import "@ui5/webcomponents/dist/Button"; // loads ui5-button

    Then, you can use the custom element in an HTML page:

    <ui5-button>Hello world!</ui5-button>

Browser support

Currently Chrome, Safari, Firefox and Edge (Chromium-based) support Web Components natively.

Contributing

If you wish to contribute code, offer fixes or improvements, please send a pull request. Due to legal reasons, contributors will be asked to accept a DCO when they create the first pull request to this project. This happens in an automated fashion during the submission process. SAP uses the standard DCO text of the Linux Foundation.

License

Copyright (c) 2021 SAP SE or an SAP affiliate company. All rights reserved. This project is licensed under the Apache Software License, version 2.0 except as noted otherwise in the LICENSE file.