Skip to content
Snippets Groups Projects
Use-a-component-alone-in-an-existing-application.rst 2.31 KiB
Newer Older
Alice Poggioli's avatar
Alice Poggioli committed
Add a component to a website
Alice Poggioli's avatar
Alice Poggioli committed
***************************
Alice Poggioli's avatar
Alice Poggioli committed
   Use Startin'blox according to your needs.
Alice Poggioli's avatar
Alice Poggioli committed
Startin'blox was designed to be modular. You need to add a calendar or a map to your website? 
SiB allows you to add functionality in a few minutes, with the minimum of skills.

Here, we will see how to add a Startin'blox component to an existing HTML page. You can follow the steps with your own website, or with an empty HTML page for practice.

No need for complicated tools or installations: to follow this section, you just need an internet connection and a minute of your time.

1. Import the core of Startin’blox
----------------------------------



2. Import the component you want
--------------------------------

In the documentation of the component you’ve chosen, you’ll find the
script to import.

.. code:: html
Alice Poggioli's avatar
Alice Poggioli committed
      <!-- ... Import the core ... -->
      <script type="module" src="https://unpkg.com/@startinblox/core"></script>
      <!-- ... Import your component ... -->
      <script type="module" src="https://unpkg.com/@startinblox/my-sib-component"></script>
   </head>

3. Use your component
---------------------

Alice Poggioli's avatar
Alice Poggioli committed
A component is a simple tag with attributes that allow us to customize its behavior.

The main interest of startin'blox is to be able to plug to your component the data sources of your choice. It can be public data sources or your own data sources.
Alice Poggioli's avatar
Alice Poggioli committed
=> `How to create your own data sources <How-to-make-components/>`__

Each component has its own documentation where you'll fine the script import and its use.
Alice Poggioli's avatar
Alice Poggioli committed
   <sib-component
     data-src="http://api.myadress.com/sources/"
     fields="attribute_X, attribute_Y"
   ></sib-component>


That's it!

Now all you have to do is stylize it :)



Are you in some kind of trouble?
--------------------------------
   There are to kind of component : **the officials ones** and **the community ones**.

If the component you have a problem with is an official component, `ask the Startin'blox team for help <https://community.startinblox.com/>`__!

If it is a Community component, in the readme.md of the component should give you the address of the maintainer. You can contact them directly.

If the component does not quite meet your expectations, you can also propose your variation.

=> `See how to develop components <How-to-make-components/>`__.