SCodeExampleComponent

  This CustomElement make use of related resource(s).

This component represent a code example that make sure your passed code(s) is displayed well using under the hood the AMAZING highlightjs library.

Platform  
html
   â”‚    Support  
Chromium supported
Firefox supported
Safari supported
Edge supported
Since  2.0.0
   â”‚   
Olivier Bossel
Olivier Bossel
   â”‚   
beta

  Preview

 

Loading code example. Please wait...

 

Loading code example. Please wait...

  Features

  • Can display out of the bos codes like bash, shell, css, js, php and html

  • Possibility to add some languages through the property languages

  • Full support for sugar theming system for easy integration

  Import

  Install

  Interface

  1. active
    String

    Specify which "tab" is active in case of multiple languages examples

  2. toolbar
    ["copy"]
    • copy
    Array<String>

    Specify what you want in the toolbar. Currently available item is "copy"

  3. toolbarPosition
    nav
    • content
    • nav
    String

    Specify the toolbar position. Can be "content" or "nav"

  4. languages
    {}
    Object

    Specify some languages that you want to support. Must be "[key]: language" object syntax. See highlight.js doc for supported languages

  5. items
    []
    Object[]

    Specify the items to put in your code example

  6. lines
    15
    Number

    Specify how many lines to display at max

  7. moreLabel
    Show more
    String

    Specify the "show more" button label

  8. lessLabel
    Show less
    String

    Specigy the "show less" button label

  9. moreAction
    toggle
    • toggle
    String

    Specify the action to execute when click on the "more" button. Currently available action is "toggle"

  10. more
    false
    Boolean

    Specify if you want to expand the more feature at start or not

  11. scrollOnMore
    true
    Boolean

    Specify if you want to scroll to the code when clicking on the "show more/less" button

  12. scrollToSettings
    {}
    Object

    Specify some scrollTo settings

highlight.js

197 languages and 248 styles automatic language detection multi-language code highlighting available for node.js works with any markup compatible with any js framework Get version 11.7.0 Usage

Bugs
are not our friends...

Don't hesitate to declare an issue if something does not works as expected.

Declare my issue on Github Talk about it on Discord

The more we are,
the stronger we become.

Don't hesitate to tell some words to you friends about us. The goal is to became more and more each days to help each others...

Support us on Patreon! Share on Facebook! Make a tweet!

The more we are,
the stronger we become.

Don't be afraid to join us on Discord.

Join us on discord!

We love,
Open source!

All of our codebase can be found on Github. We hope that you may contribute to help us make our tools even better!

Discover our codebase!

Welcome on