Language drop-down specs
To embed an automatic language drop-down to your page use the following HTML element:
<span
class="bs-activator"
[data-drop="auto|right|left|right-top|left-top"]
[data-theme="light|dark"]
[data-css="https://...."]
[data-dialog-style="...."]
[data-flag-class="...."]
[data-middle-text="...."]
[data-middle-text-class="...."]
[data-hide-chevron]
></span>The minimal code snippet is <span class="bs-activator"></span>.
Configuration attributes
Custom menu button
You can make the language selector look like a regular menu item: show a flag, add a “Language” label and hide the dropdown arrow:
The class names in this example are yours to define. BabelShark keeps the snippet’s classes on the generated button (except bs-activator), so you can use your existing menu styles. A <button> snippet remains a native button and can be activated with the keyboard.
For a square flag area, you can start with these styles:
object-fit: contain keeps the flag’s proportions inside the square area.
These optional attributes affect only the button’s appearance, not how languages are selected. Without them, the usual flag-and-arrow button stays unchanged.
Last updated