🏷️Labels widget
Trustblock labels are visual gateways to display the security state of a project on a website.
Setup
Import the script to your website entry HTML file, as follows:
Start adding labels anywhere you want on your website:
Parameters
Each label div must have the data-tb-project-widget
attribute.
You might prefer to pass some arguments over others, depending on your case.
Use Case #1: Static context
If you already know the project you want to display the label for and are not in a dynamic context, then you should use data-tb-project-slug
.
Head to beta.trustblock.run, find the project you want to get the label for, and copy the slug in the URL.
Then declare your div as follows:
Use Case #2: Dynamic context
If you are in a dynamic context, then you should use data-tb-contract-evm-address
alongside with data-tb-contract-chain
.
Declare your div as follows:
data-tb-contract-evm-address
: is the address of the contract.data-tb-contract-chain
: see supported chains
Optionally, you can add the following attributes with hexadecimal color values to customize the render:
data-tb-text-color
: accepts a hexadecimal valuedata-tb-bg-color
: accepts a hexadecimal valuedata-tb-colorborder
: accepts a hexadecimal valuedata-tb-mode
: can either befill
orfit-content
data-tb-size
: can either besmall
,medium
orlarge
Last updated